prevent exception when view.window() is None

This commit is contained in:
Alan Hamlett 2015-03-25 11:08:27 -07:00
parent 48bbab33b4
commit 911b5656d7

View file

@ -151,9 +151,12 @@ def find_project_name_from_folders(folders):
def handle_action(view, is_write=False): def handle_action(view, is_write=False):
window = view.window()
if window is not None:
target_file = view.file_name() target_file = view.file_name()
project = view.window().project_file_name() if hasattr(view.window(), 'project_file_name') else None project = window.project_file_name() if hasattr(window, 'project_file_name') else None
thread = SendActionThread(target_file, view, is_write=is_write, project=project, folders=view.window().folders()) folders = window.folders()
thread = SendActionThread(target_file, view, is_write=is_write, project=project, folders=folders)
thread.start() thread.start()