eric6/Sessions/SessionFile.py

changeset 8064
756747ba088c
parent 8031
ce5858a237d2
child 8163
29fb6d420a25
--- a/eric6/Sessions/SessionFile.py	Thu Feb 04 09:33:57 2021 +0100
+++ b/eric6/Sessions/SessionFile.py	Thu Feb 04 10:18:36 2021 +0100
@@ -355,10 +355,11 @@
                 browser.expandItemsByName(browserState["ExpandedItems"])
         
         # step 8: active window
-        vm.openFiles(sessionDict["ActiveWindow"]["Filename"])
-        ed = vm.getOpenEditor(sessionDict["ActiveWindow"]["Filename"])
-        if ed is not None:
-            ed.setCursorPosition(*sessionDict["ActiveWindow"]["Cursor"])
-            ed.ensureCursorVisible()
+        if sessionDict["ActiveWindow"]:
+            vm.openFiles(sessionDict["ActiveWindow"]["Filename"])
+            ed = vm.getOpenEditor(sessionDict["ActiveWindow"]["Filename"])
+            if ed is not None:
+                ed.setCursorPosition(*sessionDict["ActiveWindow"]["Cursor"])
+                ed.ensureCursorVisible()
         
         return True

eric ide

mercurial