summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-03 19:07:07 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-03 19:07:07 +0200
commite607cafa2a6d7c5add9a2cb05625cc1f98a0f1ab (patch)
treef117d26db68ccb60e79df129f01a89d7c5fc0ecf
parent442abdaac7e6af5a91d5ddf6ab02270e190289ff (diff)
SL-16434 Crash opening landmarks
potentially due to corrupted install, handling just in case
-rw-r--r--indra/newview/llpanellandmarks.cpp37
1 files changed, 28 insertions, 9 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index e698a61fef..ce17da3076 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -438,8 +438,14 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list
LLPlacesFolderView* root_folder = dynamic_cast<LLPlacesFolderView*>(inventory_list->getRootFolder());
if (root_folder)
{
- root_folder->setupMenuHandle(LLInventoryType::IT_CATEGORY, mGearFolderMenu->getHandle());
- root_folder->setupMenuHandle(LLInventoryType::IT_LANDMARK, mGearLandmarkMenu->getHandle());
+ if (mGearFolderMenu)
+ {
+ root_folder->setupMenuHandle(LLInventoryType::IT_CATEGORY, mGearFolderMenu->getHandle());
+ }
+ if (mGearLandmarkMenu)
+ {
+ root_folder->setupMenuHandle(LLInventoryType::IT_LANDMARK, mGearLandmarkMenu->getHandle());
+ }
root_folder->setParentLandmarksPanel(this);
}
@@ -462,13 +468,23 @@ void LLLandmarksPanel::initListCommandsHandlers()
mSortingMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_places_gear_sorting.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mAddMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
- mGearLandmarkMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
- mGearFolderMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
+ if (mGearLandmarkMenu)
+ {
+ mGearLandmarkMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
+ // show menus even if all items are disabled
+ mGearLandmarkMenu->setAlwaysShowMenu(TRUE);
+ } // Else corrupted files?
+
+ if (mGearFolderMenu)
+ {
+ mGearFolderMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
+ mGearFolderMenu->setAlwaysShowMenu(TRUE);
+ }
- // show menus even if all items are disabled
- mGearLandmarkMenu->setAlwaysShowMenu(TRUE);
- mGearFolderMenu->setAlwaysShowMenu(TRUE);
- mAddMenu->setAlwaysShowMenu(TRUE);
+ if (mAddMenu)
+ {
+ mAddMenu->setAlwaysShowMenu(TRUE);
+ }
}
void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu)
@@ -1054,7 +1070,10 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark)
LLFloaterReg::showInstance("world_map", "center");
}
- mGearLandmarkMenu->setItemEnabled("show_on_map", TRUE);
+ if (mGearLandmarkMenu)
+ {
+ mGearLandmarkMenu->setItemEnabled("show_on_map", TRUE);
+ }
}
void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark,