sometime(eg ediff-mode) file become nil and cause error.

sometime(eg ediff-mode) file become nil and cause error.
so add test to make sure file is not null.