Fixed an exception when the current buffer has no file name.