#2095 Crash #1497728: LLInventorySingleFolderPanel::hasVisibleItems

master
Alexander Gavriliuk 2024-07-24 17:15:07 +02:00 committed by Guru
parent aaa5caeca8
commit 603f448393
2 changed files with 14 additions and 9 deletions

View File

@ -2334,14 +2334,14 @@ void LLInventorySingleFolderPanel::clearNavigationHistory()
mBackwardFolders.clear();
}
bool LLInventorySingleFolderPanel::isBackwardAvailable()
bool LLInventorySingleFolderPanel::isBackwardAvailable() const
{
return (!mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back()));
return !mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back());
}
bool LLInventorySingleFolderPanel::isForwardAvailable()
bool LLInventorySingleFolderPanel::isForwardAvailable() const
{
return (!mForwardFolders.empty() && (mFolderID != mForwardFolders.back()));
return !mForwardFolders.empty() && (mFolderID != mForwardFolders.back());
}
boost::signals2::connection LLInventorySingleFolderPanel::setRootChangedCallback(root_changed_callback_t cb)
@ -2406,9 +2406,14 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()
}
}
bool LLInventorySingleFolderPanel::hasVisibleItems()
bool LLInventorySingleFolderPanel::hasVisibleItems() const
{
return mFolderRoot.get()->hasVisibleChildren();
if (const LLFolderView* root = mFolderRoot.get())
{
return root->hasVisibleChildren();
}
return false;
}
void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata)

View File

@ -420,10 +420,10 @@ public:
void doToSelected(const LLSD& userdata);
void doShare();
bool isBackwardAvailable();
bool isForwardAvailable();
bool isBackwardAvailable() const;
bool isForwardAvailable() const;
bool hasVisibleItems();
bool hasVisibleItems() const;
void setNavBackwardList(std::list<LLUUID> backward_list) { mBackwardFolders = backward_list; }
void setNavForwardList(std::list<LLUUID> forward_list) { mForwardFolders = forward_list; }