summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-19 08:18:58 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-19 08:18:58 (GMT)
commitc6db044c3788477eac0fd27d3b3e7676f9785acb (patch)
tree59381af1197210c653b271505e83dcdebd4d66e8
parent6c93d25330b5d1392c71eaa099cdce045f70cca8 (diff)
Check for nullptr in mSubscribers list before derefencing it
-rw-r--r--src/server/notificationsubscriber.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/notificationsubscriber.cpp b/src/server/notificationsubscriber.cpp
index 790ea34..887880b 100644
--- a/src/server/notificationsubscriber.cpp
+++ b/src/server/notificationsubscriber.cpp
@@ -246,9 +246,11 @@ void NotificationSubscriber::modifySubscription(const Protocol::ModifySubscripti
// If yes, then send them list of all existing subscribers
Q_FOREACH (const NotificationSubscriber *subscriber, mManager->mSubscribers) {
// Send them back to caller
- QMetaObject::invokeMethod(this, "notify", Qt::QueuedConnection,
- Q_ARG(Akonadi::Protocol::ChangeNotification,
- subscriber->toChangeNotification()));
+ if (subscriber) {
+ QMetaObject::invokeMethod(this, "notify", Qt::QueuedConnection,
+ Q_ARG(Akonadi::Protocol::ChangeNotification,
+ subscriber->toChangeNotification()));
+ }
}
}
if (command.startMonitoringTypes().contains(Protocol::ModifySubscriptionCommand::ChangeNotifications)) {