Add a try block around view.window().project_file_name()