After re-reading your previous diagnosis, I think there is a shorter
fix. Searching for 'end-name starting from beg instead of (1+ beg)
finds the end of filename correctly whether the filename is empty or
not.
Once wdired-get-filename is fixed, wdired-finish-edit actually needs
no changes, because (wdired-get-filename) does return nil when the
filename is empty.
* wdired.el (wdired-get-filename): Change `(1+ beg)' to `beg' so
that the filename end is found even when the filename is empty.
Fixes error and spurious newlines when marking files for deletion.