From fb80c4b859c6a7c0667b7ab75081ade9d3943e6c Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Tue, 18 Sep 2012 15:08:15 -0700 Subject: MAINT-1580 - Viewer shows "Unknown Notification" message on startup. Reviewed by Kelly --- indra/newview/llnotificationstorage.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index fb1adc7ddf..4df2a79b61 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -164,21 +164,29 @@ void LLPersistentNotificationStorage::loadNotifications() ++notification_it) { LLSD notification_params = *notification_it; - LLNotificationPtr notification(new LLNotification(notification_params)); - LLNotificationResponderPtr responder(LLResponderRegistry:: - createResponder(notification_params["name"], notification_params["responder"])); - notification->setResponseFunctor(responder); + if (instance.templateExists(notification_params["name"].asString())) + { + LLNotificationPtr notification(new LLNotification(notification_params)); + + LLNotificationResponderPtr responder(LLResponderRegistry:: + createResponder(notification_params["name"], notification_params["responder"])); + notification->setResponseFunctor(responder); - instance.add(notification); + instance.add(notification); - // hide script floaters so they don't confuse the user and don't overlap startup toast - LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); + // hide script floaters so they don't confuse the user and don't overlap startup toast + LLScriptFloaterManager::getInstance()->setFloaterVisible(notification->getID(), false); - if(notification_channel) + if(notification_channel) + { + // hide saved toasts so they don't confuse the user + notification_channel->hideToast(notification->getID()); + } + } + else { - // hide saved toasts so they don't confuse the user - notification_channel->hideToast(notification->getID()); + llwarns << "Failed to find template for persistent notification " << notification_params["name"].asString() << llendl; } } } -- cgit v1.2.3