Fix possible crash, mostly occurring on notification flood. 178/head
authorHannah von Reth <vonreth@kde.org>
Wed, 3 Feb 2016 09:37:01 +0000 (10:37 +0100)
committerHannah von Reth <vonreth@kde.org>
Wed, 3 Feb 2016 09:37:01 +0000 (10:37 +0100)
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)