Handle empty session files gracefully
There's still much more to do for #1926, but with this we at least handle one common case gracefully. No tests because test_sessions.py is still in a kinda bad place...
This commit is contained in:
parent
737db48c14
commit
22a4aaa73c
@ -75,6 +75,7 @@ Fixed
|
|||||||
- When no documentation has been generated, the plaintext documentation now can
|
- When no documentation has been generated, the plaintext documentation now can
|
||||||
be shown for more files such as `qute://help/userscripts.html`.
|
be shown for more files such as `qute://help/userscripts.html`.
|
||||||
- Crash when doing initial run on Wayland without XWayland
|
- Crash when doing initial run on Wayland without XWayland
|
||||||
|
- Crash when trying to load an empty session file.
|
||||||
|
|
||||||
Removed
|
Removed
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
@ -414,6 +414,9 @@ class SessionManager(QObject):
|
|||||||
raise SessionError(e)
|
raise SessionError(e)
|
||||||
|
|
||||||
log.sessions.debug("Loading session {} from {}...".format(name, path))
|
log.sessions.debug("Loading session {} from {}...".format(name, path))
|
||||||
|
if data is None:
|
||||||
|
raise SessionError("Got empty session file")
|
||||||
|
|
||||||
for win in data['windows']:
|
for win in data['windows']:
|
||||||
window = mainwindow.MainWindow(geometry=win['geometry'],
|
window = mainwindow.MainWindow(geometry=win['geometry'],
|
||||||
private=win.get('private', None))
|
private=win.get('private', None))
|
||||||
|
Loading…
Reference in New Issue
Block a user