summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-11-20 13:29:00 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2016-11-24 14:42:15 (GMT)
commit6416009561ce800cde2824bbf369a32687b6fdfe (patch)
tree6fc694df6961697206676c7129e26a06b631a003
parent76453a7df8427048a8ce92169c3dbd172f89798c (diff)
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 (cherry picked from commit c5ccfc20e8265f92ca73e8714a42f8691d68d2c2)
-rw-r--r--src/SessionManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp
index 2cb1bdb..5413a31 100644
--- a/src/SessionManager.cpp
+++ b/src/SessionManager.cpp
@@ -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;
}