diff options
| author | angela <angela@lindenlab.com> | 2010-02-03 13:56:39 +0800 |
|---|---|---|
| committer | angela <angela@lindenlab.com> | 2010-02-03 13:56:39 +0800 |
| commit | 460ec67b97bc210c0a03483dd0b754e92fabe806 (patch) | |
| tree | 90bd49da9c7e23e6b90ebf04b8fcc9847b4f414e /indra/newview/llinventorymodel.cpp | |
| parent | 1094fa28c618370af9a95cf823cbd9287c92dd24 (diff) | |
| parent | 86923afd27d76734cf1274fa788928230c232a4d (diff) | |
resolve merge in llsidepanelinventory.cpp
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
| -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; } |
