mirror of
https://github.com/KDE/konsole.git
synced 2026-06-13 00:15:55 -04:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user