diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -1475,9 +1475,10 @@ class Editor(SpyderPluginWidget):
     def refresh_save_all_action(self):

         """Enable 'Save All' if there are files to be saved"""

         editorstack = self.get_current_editorstack()

-        state = any(finfo.editor.document().isModified()

-                    for finfo in editorstack.data)

-        self.save_all_action.setEnabled(state)

+        if editorstack:

+            state = any(finfo.editor.document().isModified()

+                        for finfo in editorstack.data)

+            self.save_all_action.setEnabled(state)

             

     def update_warning_menu(self):

         """Update warning list menu"""
Adds a validation for the editorstack existence.