From c5ccfc20e8265f92ca73e8714a42f8691d68d2c2 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sun, 20 Nov 2016 14:29:00 +0100 Subject: [PATCH] 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 --- src/SessionManager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 2cb1bdbfe..5413a31d6 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; }