From 19a89f9e4777f2337dda55cb01ce674b7f34d4f4 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Mon, 13 Jan 2014 11:18:00 +0100 Subject: [PATCH] fixed crash --- .../frontends/snarlnetwork/snarlnetwork.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp b/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp index 2ca42c0..6054098 100644 --- a/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp +++ b/src/plugins/frontends/snarlnetwork/snarlnetwork.cpp @@ -53,16 +53,20 @@ bool SnarlNetworkFrontend::init(SnoreCore *snore){ } -void SnarlNetworkFrontend::actionInvoked(Notification notification){ +void SnarlNetworkFrontend::actionInvoked(Notification notification) +{ //TODO:fix callback - SnarlNotification sn=notifications.value(notification.id()); - if(notification.actionInvoked().id() == 1 ) + if(notifications.contains(notification.id())) { - callback(sn,"SNP/1.1/304/Notification acknowledged/"); - } - else if(notification.actionInvoked().id() == 2) - { - callback(sn,"SNP/1.1/302/Notification cancelled/"); + SnarlNotification sn=notifications.value(notification.id()); + if(notification.actionInvoked().id() == 1 ) + { + callback(sn,"SNP/1.1/304/Notification acknowledged/"); + } + else if(notification.actionInvoked().id() == 2) + { + callback(sn,"SNP/1.1/302/Notification cancelled/"); + } } } void SnarlNetworkFrontend::notificationClosed(Notification notification)