Don't crash/assert on trying to load session with invalid ID

Failing to find a ID should not be a fatal assert, the ViewManager
handles it properly.

BUG: 372173
This commit is contained in:
Martin T. H. Sandsmark
2016-11-20 14:29:00 +01:00
parent 80b9e0775e
commit c5ccfc20e8

View File

@@ -314,13 +314,12 @@ void SessionManager::restoreSessions(KConfig* config)
Session* SessionManager::idToSession(int id)
{
Q_ASSERT(id);
foreach(Session * session, _sessions) {
if (session->sessionId() == id)
return session;
}
// this should not happen
Q_ASSERT(0);
return 0;
qWarning() << "Failed to find session for ID" << id;
return nullptr;
}