summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorBaker Linden <baker@lindenlab.com>2013-07-09 15:35:00 -0700
committerBaker Linden <baker@lindenlab.com>2013-07-09 15:35:00 -0700
commitd65e34319a3c3e58f6d278951ab5047a784e9992 (patch)
tree9f7f716c3cf9f0fdef6f952a5177591a1fd04e76 /indra/newview/llfavoritesbar.cpp
parentd75ae6b4f43ffb82bd5db6b6b59ae3d9b8b7e989 (diff)
parent830e3ea0ec83070b56b805e43cb3ad261c413802 (diff)
[MAINT-2386] - Viewer crashes when user move landmarks from Inventory -> Landmarks or Places to Favorite bar
- Pushed to viewer-cat for release.
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rwxr-xr-xindra/newview/llfavoritesbar.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 6d90667194..d5e26f593b 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1,4 +1,4 @@
-/**
+]/**
* @file llfavoritesbar.cpp
* @brief LLFavoritesBarCtrl class implementation
*
@@ -550,6 +550,10 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
bool insert_before = true;
if (!mItems.empty())
{
+ // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar,
+ // the viewer would crash when casting mLastTab below, as mLastTab is still null when the
+ // second landmark is being added.
+ // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function
dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab);
if (!dest)
{
@@ -621,6 +625,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
cb);
}
+ // [MAINT-2386] Ensure the favorite button has been created and is valid.
+ // This also ensures that mLastTab will be valid when dropping multiple
+ // landmarks to an empty favorites bar.
+ updateButtons();
+
llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl;
}