summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-02 08:31:39 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-02 08:31:39 (GMT)
commit67cf8daa6d43205c3b6ecc98da8e10c196c741bd (patch)
tree0fb2bdf9209027296132d164cce593c8efca5c55 /SwifTools
parentb27133205a1c1220d8c82f1e87a68a8b6fd2c644 (diff)
downloadswift-67cf8daa6d43205c3b6ecc98da8e10c196c741bd.zip
swift-67cf8daa6d43205c3b6ecc98da8e10c196c741bd.tar.bz2
Do not crash when clicking system message notifications.
Resolves: #818
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/Notifier/GrowlNotifier.cpp2
-rw-r--r--SwifTools/Notifier/SnarlNotifier.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/SwifTools/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp
index 5ecd34c..e289313 100644
--- a/SwifTools/Notifier/GrowlNotifier.cpp
+++ b/SwifTools/Notifier/GrowlNotifier.cpp
@@ -31,7 +31,7 @@ namespace {
assert(CFDataGetLength(growlContextData) == sizeof(Context));
CFDataGetBytes(growlContextData, CFRangeMake(0, CFDataGetLength(growlContextData)), (UInt8*) &context);
- if (activateCallback) {
+ if (activateCallback && !context.callback->empty()) {
(*context.callback)();
}
delete context.callback;
diff --git a/SwifTools/Notifier/SnarlNotifier.cpp b/SwifTools/Notifier/SnarlNotifier.cpp
index e93a539..d891e7d 100644
--- a/SwifTools/Notifier/SnarlNotifier.cpp
+++ b/SwifTools/Notifier/SnarlNotifier.cpp
@@ -58,7 +58,7 @@ void SnarlNotifier::handleMessageReceived(MSG* message) {
int notificationID = message->lParam;
NotificationsMap::iterator i = notifications.find(notificationID);
if (i != notifications.end()) {
- if (action == Snarl::V41::SnarlEnums::NotificationAck) {
+ if (action == Snarl::V41::SnarlEnums::NotificationAck && !i->second.empty()) {
i->second();
}
notifications.erase(i);