Fix crash when no file is selected.