summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-03-29 14:40:33 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-03-29 16:25:17 +0200
commit193cab14c2cf629e5bf012fc830cb1132389d101 (patch)
tree80ab177ec49e9b6ff6b20ed70f0b77e8e90d8e6e /indra
parent6ac1d4f3e37f2118875a4c9e96b26e3f82e17a1e (diff)
#3836 Fix crash at LLNotificationForm::getNumElements()/LLSD::size()
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llnotifications.cpp14
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);