diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventoryfilter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8907bf4c1c..38803b4b8b 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -115,8 +115,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const LLUUID object_id = listener->getUUID(); const LLInventoryObject *object = gInventory.getObject(object_id); - if (!object) return FALSE; - const U32 filterTypes = mFilterOps.mFilterTypes; //////////////////////////////////////////////////////////////////////////////// @@ -127,11 +125,13 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // If it has no type, pass it, unless it's a link. if (object_type == LLInventoryType::IT_NONE) { - if (object->getIsLinkType()) + if (object && object->getIsLinkType()) return FALSE; } - if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) + { return FALSE; + } } // //////////////////////////////////////////////////////////////////////////////// @@ -143,6 +143,10 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // if its parent is a category of the filter type. if (filterTypes & FILTERTYPE_CATEGORY) { + // Can only filter categories for items in your inventory + // (e.g. versus in-world object contents). + if (!object) return FALSE; + LLUUID cat_id = object_id; if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) { @@ -163,6 +167,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) // Pass if this item is the target UUID or if it links to the target UUID if (filterTypes & FILTERTYPE_UUID) { + if (!object) return FALSE; + if (object->getLinkedUUID() != mFilterOps.mFilterUUID) return FALSE; } |