Skip to content

Commit

Permalink
Editor: Fix bug when calling update_edit_menu at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Sep 5, 2024
1 parent 9de1f09 commit 4a4775b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spyder/plugins/editor/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,11 @@ def update_edit_menu(self):
editor = self.get_current_editor()
readwrite_editor = possible_text_widget == editor

if readwrite_editor and not editor.isReadOnly():
# We need the first validation to avoid a bug at startup. That probably
# happens when the menu is tried to be rendered automatically in some
# Linux distros.
# Fixes spyder-ide/spyder#22432
if editor is not None and readwrite_editor and not editor.isReadOnly():
# Case where the current editor has the focus
if not self.is_file_opened():
return
Expand Down

0 comments on commit 4a4775b

Please sign in to comment.