From 443d1b08b22262566dc4d476ca0bdef665518721 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 21 Oct 2011 18:51:39 -0700 Subject: EXP-1439 : Fix potential crash when the favorites bar is empty --- indra/newview/llfavoritesbar.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra') 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(mLandingTab); - bool insert_before = true; - if (!dest) + LLFavoriteLandmarkButton* dest = NULL; + bool insert_before = true; + if (!mItems.empty()) { - insert_before = false; - dest = dynamic_cast(mLastTab); + dest = dynamic_cast(mLandingTab); + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } } // There is no need to handle if an item was dragged onto itself -- cgit v1.2.3