SessionFile: corrected an issue reading a session file with an empty active window entry.

Thu, 04 Feb 2021 10:18:36 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 04 Feb 2021 10:18:36 +0100
changeset 8064
756747ba088c
parent 8063
c2b07b12ad30
child 8065
3554ff6fbba5

SessionFile: corrected an issue reading a session file with an empty active window entry.

eric6/Sessions/SessionFile.py file | annotate | diff | comparison | revisions
--- 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