summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 16:20:53 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 18:30:07 (GMT)
commit13684bebe2a421157032bc3cfaf28e468d0c1eef (patch)
treedf1a93fee29f03180408d2b9d66a34a2f9d81bb0
parent69c8a0e3dbc7a879227a336832b3d9529eea6e49 (diff)
Fix crash when failing to restore session
REVIEW: 128670 BUG: 366217
-rw-r--r--src/ViewManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index 90ef863..b1efc0a 100644
--- a/src/ViewManager.cpp
+++ b/src/ViewManager.cpp
@@ -941,6 +941,14 @@ void ViewManager::restoreSessions(const KConfigGroup& group)
int tab = 1;
foreach(int id, ids) {
Session* session = SessionManager::instance()->idToSession(id);
+
+ if (!session) {
+ qWarning() << "Unable to load session with id" << id;
+ // Force a creation of a default session below
+ ids.clear();
+ break;
+ }
+
createView(session);
if (!session->isRunning())
session->run();