From d4a370a5f2b010727b1a2fdcc6526b7b13c72962 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 7 Apr 2012 14:52:15 -0700 Subject: A few more minor improvements on Suitcase inventory service. --- .../Services/HypergridService/HGSuitcaseInventoryService.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services/HypergridService') diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 6a6181a..53fbea6 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -107,7 +107,6 @@ namespace OpenSim.Services.HypergridService public override List GetInventorySkeleton(UUID principalID) { XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); - XInventoryFolder root = GetRootXFolder(principalID); List tree = GetFolderTree(principalID, suitcase.folderID); if (tree == null || (tree != null && tree.Count == 0)) @@ -119,7 +118,7 @@ namespace OpenSim.Services.HypergridService folders.Add(ConvertToOpenSim(x)); } - SetAsNormalFolder(suitcase, root); + SetAsNormalFolder(suitcase); folders.Add(ConvertToOpenSim(suitcase)); return folders; @@ -134,12 +133,11 @@ namespace OpenSim.Services.HypergridService userInventory.Items = new List(); XInventoryFolder suitcase = GetSuitcaseXFolder(userID); - XInventoryFolder root = GetRootXFolder(userID); List tree = GetFolderTree(userID, suitcase.folderID); if (tree == null || (tree != null && tree.Count == 0)) { - SetAsNormalFolder(suitcase, root); + SetAsNormalFolder(suitcase); userInventory.Folders.Add(ConvertToOpenSim(suitcase)); return userInventory; } @@ -164,7 +162,7 @@ namespace OpenSim.Services.HypergridService userInventory.Items.AddRange(items); } - SetAsNormalFolder(suitcase, root); + SetAsNormalFolder(suitcase); userInventory.Folders.Add(ConvertToOpenSim(suitcase)); m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetUserInventory for user {0} returning {1} folders and {2} items", @@ -181,6 +179,7 @@ namespace OpenSim.Services.HypergridService if (root == null) { m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve local root folder for user {0}", principalID); + return null; } // Warp! Root folder for travelers is the suitcase folder @@ -200,7 +199,7 @@ namespace OpenSim.Services.HypergridService CreateSystemFolders(principalID, suitcase.folderID); } - SetAsNormalFolder(suitcase, root); + SetAsNormalFolder(suitcase); return ConvertToOpenSim(suitcase); } @@ -484,7 +483,7 @@ namespace OpenSim.Services.HypergridService return null; } - private void SetAsNormalFolder(XInventoryFolder suitcase, XInventoryFolder root) + private void SetAsNormalFolder(XInventoryFolder suitcase) { suitcase.type = (short)AssetType.Folder; } -- cgit v1.1