Fix crash when failing to restore session

REVIEW: 128670
BUG: 366217
This commit is contained in:
Martin T. H. Sandsmark
2016-08-13 18:20:53 +02:00
parent 69c8a0e3db
commit 13684bebe2

View File

@@ -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();