diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-03-29 14:40:33 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-03-29 16:25:17 +0200 |
commit | 193cab14c2cf629e5bf012fc830cb1132389d101 (patch) | |
tree | 80ab177ec49e9b6ff6b20ed70f0b77e8e90d8e6e /indra | |
parent | 6ac1d4f3e37f2118875a4c9e96b26e3f82e17a1e (diff) |
#3836 Fix crash at LLNotificationForm::getNumElements()/LLSD::size()
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llnotifications.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 6fc9b90fb8..634d8f71a2 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -614,6 +614,13 @@ void LLNotification::cancel() LLSD LLNotification::getResponseTemplate(EResponseTemplateType type) { LLSD response = LLSD::emptyMap(); + + if (!mForm) + { + LL_WARNS("Notifications") << "Null form when getting response template for notification " << getName() << LL_ENDL; + return response; + } + for (S32 element_idx = 0; element_idx < mForm->getNumElements(); ++element_idx) @@ -1465,6 +1472,13 @@ bool LLNotifications::templateExists(std::string_view name) void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option) { LLNotificationPtr temp_notify(new LLNotification(params)); + + if (!temp_notify->getForm()) + { + LL_WARNS("Notifications") << "Cannot force response for notification with null form: " << (std::string)params.name << LL_ENDL; + return; + } + LLSD response = temp_notify->getResponseTemplate(); LLSD selected_item = temp_notify->getForm()->getElement(option); |