Merge pull request #178 from TheOneRing/fix_snore_crash
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 8 Feb 2016 20:34:48 +0000 (21:34 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 8 Feb 2016 20:34:48 +0000 (21:34 +0100)
Fix possible crash, mostly occurring on notification flood.

src/qtui/snorenotificationbackend.cpp

index 69ce0e0..6c125d9 100644 (file)
@@ -91,7 +91,9 @@ void SnoreNotificationBackend::close(uint notificationId)
     }
 #endif
     Snore::Notification n = Snore::SnoreCore::instance().getActiveNotificationByID(m_notificationIds.take(notificationId));
-    Snore::SnoreCore::instance().requestCloseNotification(n, Snore::Notification::Closed);
+    if (n.isValid()) { // Don't close the notification if it no longer exists.
+        Snore::SnoreCore::instance().requestCloseNotification(n, Snore::Notification::Closed);
+    }
 }
 
 void SnoreNotificationBackend::actionInvoked(Snore::Notification n)