Skip to content

Commit 895a673

Browse files
committed
#3750 Crash at isSaveTextureEnabled
1 parent 17fbbef commit 895a673

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

indra/newview/llpanelmaininventory.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ void LLPanelMainInventory::initInventoryViews()
15821582

15831583
void LLPanelMainInventory::toggleViewMode()
15841584
{
1585-
if(mSingleFolderMode && isCombinationViewMode())
1585+
if(mSingleFolderMode && isCombinationViewMode() && mCombinationGalleryPanel->getRootFolder().notNull())
15861586
{
15871587
mCombinationInventoryPanel->getRootFolder()->setForceArrange(false);
15881588
}
@@ -2047,7 +2047,8 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata)
20472047
}
20482048
else
20492049
{
2050-
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
2050+
LLFolderView* root_folder = getActivePanel() ? getActivePanel()->getRootFolder() : nullptr;
2051+
LLFolderViewItem* current_item = root_folder ? root_folder->getCurSelectedItem() : nullptr;
20512052
if (current_item)
20522053
{
20532054
inv_item = dynamic_cast<LLViewerInventoryItem*>(static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getInventoryObject());
@@ -2443,8 +2444,6 @@ void LLPanelMainInventory::updateCombinationVisibility()
24432444
mCombinationGalleryPanel->handleModifiedFilter();
24442445
}
24452446

2446-
getActivePanel()->getRootFolder();
2447-
24482447
if (mReshapeInvLayout
24492448
&& show_inv_pane
24502449
&& (mCombinationGalleryPanel->hasVisibleItems() || mCombinationGalleryPanel->areViewsInitialized())
@@ -2501,8 +2500,12 @@ void LLPanelMainInventory::updateCombinationVisibility()
25012500
&& mCombinationInventoryPanel->areViewsInitialized())
25022501
{
25032502
mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, true);
2504-
mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();
2505-
mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(true);
2503+
LLFolderView* root = mCombinationInventoryPanel->getRootFolder();
2504+
if (root)
2505+
{
2506+
root->scrollToShowSelection();
2507+
root->setNeedsAutoRename(true);
2508+
}
25062509
mCombInvUUIDNeedsRename.setNull();
25072510
}
25082511
}

0 commit comments

Comments
 (0)