tags 36520 + patch quit Ivaylo Ilionov writes: > When submitting form with various fields including one optional > field for file upload, if the file filed is left empty - the > submition doesn't work. > > The error is: Wrong type argument: stringp, nil Could you please give an example of such a form, for reproduction/testing purposes? > I've tracked the problem to the function 'eww-submit' which tries > to open a file for upload (the file was never initialized by the > html form). I wonder if the file not being initialised is a symptom of a problem elsewhere? An example might shed more light on this. > My fix is to check if the property is set in the file "eww.el.gz" after > line 1435: > >> ((equal (plist-get input :type) "file") >> ;; FIX check if property :filename is not nil >> (when (not (null (plist-get input :filename))) FWIW, this is equivalent to (when (plist-get input :filename) ...). >> (push (cons "file" >> (list (cons "filedata" >> (with-temp-buffer >> (insert-file-contents >> (plist-get input :filename)) >> (buffer-string))) >> (cons "name" (plist-get input :name)) >> (cons "filename" (plist-get input :filename)))) >> values))) LGTM. Here's a patch which achieves the same effect and additionally cleans up this code a tiny bit: