Skip to content

Commit

Permalink
Prevent hard reference to the editor on the mainwindow
Browse files Browse the repository at this point in the history
  • Loading branch information
andfoy committed Jul 14, 2021
1 parent b70b66c commit 5fff317
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,10 +1474,11 @@ def update_edit_menu(self):
# instance
console, not_readonly, readwrite_editor = textedit_properties

# Editor has focus and there is no file opened in it
if (not console and not_readonly and self.editor
and not self.editor.is_file_opened()):
return
if hasattr(self, 'editor'):
# Editor has focus and there is no file opened in it
if (not console and not_readonly and self.editor
and not self.editor.is_file_opened()):
return

# Disabling all actions to begin with
for child in self.edit_menu.actions():
Expand Down

0 comments on commit 5fff317

Please sign in to comment.