[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [konsole/Applications/16.12] src: Don't crash/assert on trying to load session with invalid ID
From:       Kurt Hindenburg <kurt.hindenburg () gmail ! com>
Date:       2016-11-24 14:47:45
Message-ID: E1c9vJR-0004RX-3V () code ! kde ! org
[Download RAW message or body]

Git commit 6416009561ce800cde2824bbf369a32687b6fdfe by Kurt Hindenburg, on behalf of Martin T. H. Sandsmark.
Committed on 24/11/2016 at 14:42.
Pushed by hindenburg into branch 'Applications/16.12'.

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)

M  +2    -3    src/SessionManager.cpp

https://commits.kde.org/konsole/6416009561ce800cde2824bbf369a32687b6fdfe

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;
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic