summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 377af4384a..d964fa9170 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1582,7 +1582,7 @@ void LLPanelMainInventory::initInventoryViews()
void LLPanelMainInventory::toggleViewMode()
{
- if(mSingleFolderMode && isCombinationViewMode())
+ if(mSingleFolderMode && isCombinationViewMode() && mCombinationGalleryPanel->getRootFolder().notNull())
{
mCombinationInventoryPanel->getRootFolder()->setForceArrange(false);
}
@@ -2030,7 +2030,11 @@ void LLPanelMainInventory::onVisibilityChange( bool new_visibility )
{
menu->setVisible(false);
}
- getActivePanel()->getRootFolder()->finishRenamingItem();
+ LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : nullptr;
+ if (root_folder)
+ {
+ root_folder->finishRenamingItem();
+ }
}
}
@@ -2043,7 +2047,8 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata)
}
else
{
- LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
+ LLFolderView* root_folder = getActivePanel() ? getActivePanel()->getRootFolder() : nullptr;
+ LLFolderViewItem* current_item = root_folder ? root_folder->getCurSelectedItem() : nullptr;
if (current_item)
{
inv_item = dynamic_cast<LLViewerInventoryItem*>(static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getInventoryObject());
@@ -2425,18 +2430,20 @@ void LLPanelMainInventory::updateCombinationVisibility()
mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty);
mCombinationListLayoutPanel->setVisible(show_inv_pane);
- mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane);
- if(mCombinationInventoryPanel->hasVisibleItems())
+ LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder();
+ if (root_folder)
{
- mForceShowInvLayout = false;
+ root_folder->setForceArrange(!show_inv_pane);
+ if (mCombinationInventoryPanel->hasVisibleItems())
+ {
+ mForceShowInvLayout = false;
+ }
}
if(is_gallery_empty)
{
mCombinationGalleryPanel->handleModifiedFilter();
}
- getActivePanel()->getRootFolder();
-
if (mReshapeInvLayout
&& show_inv_pane
&& (mCombinationGalleryPanel->hasVisibleItems() || mCombinationGalleryPanel->areViewsInitialized())
@@ -2493,8 +2500,12 @@ void LLPanelMainInventory::updateCombinationVisibility()
&& mCombinationInventoryPanel->areViewsInitialized())
{
mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, true);
- mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();
- mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(true);
+ LLFolderView* root = mCombinationInventoryPanel->getRootFolder();
+ if (root)
+ {
+ root->scrollToShowSelection();
+ root->setNeedsAutoRename(true);
+ }
mCombInvUUIDNeedsRename.setNull();
}
}