From a5afdf0b9715d677ce49e24aea96c002e85e3769 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 31 Aug 2014 21:16:34 -0700 Subject: DD-179 : Return no listing for a lone object lost under the marketplace listing root --- indra/newview/llinventoryfunctions.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 58a10fe180..6986ac664f 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -841,8 +841,20 @@ S32 depth_nesting_in_marketplace(LLUUID cur_uuid) // Returns the UUID of the marketplace listing this object is in LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth) { + if (depth < 1) + { + // For objects outside the marketplace listings root (or root itself), we return a NULL UUID + return LLUUID::null; + } + else if (depth == 1) + { + // Just under the root, we return the passed UUID itself if it's a folder, NULL otherwise (not a listing) + LLViewerInventoryCategory* cat = gInventory.getCategory(cur_uuid); + return (cat ? cur_uuid : LLUUID::null); + } + + // depth > 1 LLInventoryObject* cur_object = gInventory.getObject(cur_uuid); - cur_uuid = (depth < 1 ? LLUUID::null : cur_uuid); while (depth > 1) { depth--; -- cgit v1.2.3