diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-12 12:31:59 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-12 12:31:59 -0800 |
commit | b1d03f940d4682db3e9866888d6f00f9300a55ed (patch) | |
tree | 785152edb8d8789fc8141693bb05727256a20b94 /indra | |
parent | 8aaedd0a5fc73f45684c029ca9f349d793e61e93 (diff) |
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.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldonotdisturbnotificationstorage.cpp | 32 | ||||
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 5 |
2 files changed, 25 insertions, 12 deletions
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; |