diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 18:31:51 -0800 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 18:31:51 -0800 |
commit | 86923afd27d76734cf1274fa788928230c232a4d (patch) | |
tree | 7eafa493f052a1af6edc6b132bc22c365272ede5 /indra/newview | |
parent | e518fa8df91ebe8dabf949cc6074b35f60ca083f (diff) | |
parent | 5491dd6e983f8fccbd687c7c45ef43125dfc0f6c (diff) |
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bdf1ebddac..05e366523a 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -317,7 +317,10 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const { const LLInventoryObject* obj = getObject(obj_id); - const LLUUID& parent_id = obj->getParentUUID(); + + // Search up the parent chain until we get to root or an acceptable folder. + // This assumes there are no cycles in the tree else we'll get a hang. + LLUUID parent_id = obj->getParentUUID(); while (!parent_id.isNull()) { const LLViewerInventoryCategory *cat = getCategory(parent_id); @@ -329,6 +332,7 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons { return cat; } + parent_id = cat->getParentUUID(); } return NULL; } |