#3836 Fix crash at LLNotificationForm::getNumElements()/LLSD::size()
parent
6ac1d4f3e3
commit
193cab14c2
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue