prevent exception when view.window() is None
This commit is contained in:
parent
48bbab33b4
commit
911b5656d7
1 changed files with 7 additions and 4 deletions
|
@ -151,9 +151,12 @@ def find_project_name_from_folders(folders):
|
|||
|
||||
|
||||
def handle_action(view, is_write=False):
|
||||
window = view.window()
|
||||
if window is not None:
|
||||
target_file = view.file_name()
|
||||
project = view.window().project_file_name() if hasattr(view.window(), 'project_file_name') else None
|
||||
thread = SendActionThread(target_file, view, is_write=is_write, project=project, folders=view.window().folders())
|
||||
project = window.project_file_name() if hasattr(window, 'project_file_name') else None
|
||||
folders = window.folders()
|
||||
thread = SendActionThread(target_file, view, is_write=is_write, project=project, folders=folders)
|
||||
thread.start()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue