diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index f430f837939..beddce1eaa2 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -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():