Steps to reproduce the problem: emacs -Q C-x b "Sample" RET (that is, create an empty buffer) M-x diff-buffer-with-file RET RET (confirm the default buffer) Actual result: Emacs shows "Wrong type argument: stringp, nil" Expected result: Emacs shows a more descriptive error that explains why the command couldn't be executed. I've attached a patch that implements the expected result. Thank you very much.