From b1d03f940d4682db3e9866888d6f00f9300a55ed Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 12 Feb 2013 12:31:59 -0800 Subject: CHUI-758: Group notice received in DND mode causes crash on startup when auto-exiting DND mode. Crash occurred because two instances of the Group Notice notification were trying to be added from the persistent storage and then the DND storage. --- .../newview/lldonotdisturbnotificationstorage.cpp | 32 ++++++++++++++-------- indra/newview/llviewermessage.cpp | 5 +++- 2 files changed, 25 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index f7af447a57..22f35752bd 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -164,22 +164,32 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() { offerExists = true; } - - //New notification needs to be added - notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); - LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]); - if (responder == NULL) + + //Notification already exists due to persistent storage adding it first into the notification system + if(notification) { - LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" - << notification->getType() << "'" << LL_ENDL; + notification->setDND(true); + instance.update(instance.find(notificationID)); } + //New notification needs to be added else { - LLNotificationResponderPtr responderPtr(responder); - notification->setResponseFunctor(responderPtr); + notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); + LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]); + if (responder == NULL) + { + LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" + << notification->getType() << "'" << LL_ENDL; + } + else + { + LLNotificationResponderPtr responderPtr(responder); + notification->setResponseFunctor(responderPtr); + } + + instance.add(notification); } - - instance.add(notification); + } if(imToastExists) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6bbfd30794..2340436a01 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2615,7 +2615,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["sender_name"] = name; payload["group_id"] = group_id; payload["inventory_name"] = item_name; - payload["inventory_offer"] = info ? info->asLLSD() : LLSD(); + if(info && info->asLLSD()) + { + payload["inventory_offer"] = info->asLLSD(); + } LLSD args; args["SUBJECT"] = subj; -- cgit v1.2.3