diff options
author | Merov Linden <merov@lindenlab.com> | 2011-10-21 18:51:39 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-10-21 18:51:39 -0700 |
commit | 443d1b08b22262566dc4d476ca0bdef665518721 (patch) | |
tree | 0de47900e9f1146bbb53f6bce8d073878ad24b47 /indra/newview/llfavoritesbar.cpp | |
parent | 05e2814261f1581169772f3917f1e82ad7521af9 (diff) |
EXP-1439 : Fix potential crash when the favorites bar is empty
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 4e0c838454..c48b809114 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -544,12 +544,16 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) { // Identify the button hovered and the side to drop - LLFavoriteLandmarkButton* dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); - bool insert_before = true; - if (!dest) + LLFavoriteLandmarkButton* dest = NULL; + bool insert_before = true; + if (!mItems.empty()) { - insert_before = false; - dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLastTab); + dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); + if (!dest) + { + insert_before = false; + dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLastTab); + } } // There is no need to handle if an item was dragged onto itself |