diff -r c2b07b12ad30 -r 756747ba088c eric6/Sessions/SessionFile.py --- 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