Skip to content
Snippets Groups Projects
Commit 11ed48ab authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-5097 FIXED crash in LLFloaterPay::onGive

parent d6d13e20
No related branches found
No related tags found
No related merge requests found
...@@ -367,7 +367,8 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSe ...@@ -367,7 +367,8 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSe
LLSelectNode* node = selection->getFirstRootNode(); LLSelectNode* node = selection->getFirstRootNode();
if (!node) if (!node)
{ {
//FIXME: notify user object no longer exists // object no longer exists
LLNotificationsUtil::add("PayObjectFailed");
floater->closeFloater(); floater->closeFloater();
return; return;
} }
...@@ -491,12 +492,22 @@ void LLFloaterPay::onGive(void* data) ...@@ -491,12 +492,22 @@ void LLFloaterPay::onGive(void* data)
} }
if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount)
{ {
LLUUID payee_id; LLUUID payee_id = LLUUID::null;
BOOL is_group; BOOL is_group = false;
if (floater->mObjectSelection.notNull()) if (floater->mObjectSelection.notNull())
{ {
LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); LLSelectNode* node = floater->mObjectSelection->getFirstRootNode();
node->mPermissions->getOwnership(payee_id, is_group); if (node)
{
node->mPermissions->getOwnership(payee_id, is_group);
}
else
{
// object no longer exists
LLNotificationsUtil::add("PayObjectFailed");
floater->closeFloater();
return;
}
} }
else else
{ {
...@@ -562,6 +573,10 @@ void LLFloaterPay::give(S32 amount) ...@@ -562,6 +573,10 @@ void LLFloaterPay::give(S32 amount)
msg->sendReliable( region->getHost() ); msg->sendReliable( region->getHost() );
} }
} }
else
{
LLNotificationsUtil::add("PayObjectFailed");
}
} }
else else
{ {
......
...@@ -5275,6 +5275,17 @@ Warning: The &apos;Pay object&apos; click action has been set, but it will only ...@@ -5275,6 +5275,17 @@ Warning: The &apos;Pay object&apos; click action has been set, but it will only
yestext="Pay"/> yestext="Pay"/>
</notification> </notification>
<notification
icon="alertmodal.tga"
name="PayObjectFailed"
type="alertmodal">
Payment failed: object was not found.
<tag>fail</tag>
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification <notification
icon="alertmodal.tga" icon="alertmodal.tga"
name="OpenObjectCannotCopy" name="OpenObjectCannotCopy"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment