summaryrefslogtreecommitdiff
path: root/indra/newview/lldonotdisturbnotificationstorage.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-02-12 12:31:59 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-02-12 12:31:59 -0800
commitb1d03f940d4682db3e9866888d6f00f9300a55ed (patch)
tree785152edb8d8789fc8141693bb05727256a20b94 /indra/newview/lldonotdisturbnotificationstorage.cpp
parent8aaedd0a5fc73f45684c029ca9f349d793e61e93 (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/newview/lldonotdisturbnotificationstorage.cpp')
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp32
1 files changed, 21 insertions, 11 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)