summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 21d309707a..947f74315c 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -121,7 +121,29 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
return passed;
}
-bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
+bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const
+{
+ if (!folder)
+ {
+ llwarns << "The filter can not be checked on an invalid folder." << llendl;
+ llassert(false); // crash in development builds
+ return false;
+ }
+
+ const LLFolderViewEventListener* listener = folder->getListener();
+ if (!listener)
+ {
+ llwarns << "Folder view event listener not found." << llendl;
+ llassert(false); // crash in development builds
+ return false;
+ }
+
+ const LLUUID folder_id = listener->getUUID();
+
+ return checkFolder(folder_id);
+}
+
+bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
{
// we're showing all folders, overriding filter
if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
@@ -129,9 +151,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
return true;
}
- const LLFolderViewEventListener* listener = folder->getListener();
- const LLUUID folder_id = listener->getUUID();
-
if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
{
// Can only filter categories for items in your inventory