diff options
author | Justin Clarke Casey | 2008-03-31 17:08:58 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-03-31 17:08:58 +0000 |
commit | af3118eccd0d471b748a1dd89e6899b51ae0332c (patch) | |
tree | e2dc630f183ca425c8adc6cdfa0657812c829646 /OpenSim/Framework | |
parent | * Fix for mantis 131, 796 (diff) | |
download | opensim-SC-af3118eccd0d471b748a1dd89e6899b51ae0332c.zip opensim-SC-af3118eccd0d471b748a1dd89e6899b51ae0332c.tar.gz opensim-SC-af3118eccd0d471b748a1dd89e6899b51ae0332c.tar.bz2 opensim-SC-af3118eccd0d471b748a1dd89e6899b51ae0332c.tar.xz |
* Fix problem where inventory code throws a swallowed exception on grid mode if the avatar has never logged in before
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/InventoryServiceBase.cs | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index a0228e8..3187215 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -79,25 +79,41 @@ namespace OpenSim.Framework.Communications | |||
79 | // See IInventoryServices | 79 | // See IInventoryServices |
80 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) | 80 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) |
81 | { | 81 | { |
82 | //m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); | 82 | try |
83 | |||
84 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); | ||
85 | |||
86 | InventoryFolderBase rootFolder = RequestRootFolder(userId); | ||
87 | userFolders.Add(rootFolder); | ||
88 | |||
89 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | ||
90 | { | 83 | { |
91 | IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.folderID); | 84 | m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); |
92 | userFolders.AddRange(folders); | 85 | |
93 | } | 86 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); |
94 | 87 | ||
95 | // foreach (InventoryFolderBase folder in userFolders) | 88 | InventoryFolderBase rootFolder = RequestRootFolder(userId); |
96 | // { | 89 | |
97 | // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); | 90 | // Agent is completely new and has no inventory structure yet. |
98 | // } | 91 | if (null == rootFolder) |
92 | { | ||
93 | return null; | ||
94 | } | ||
95 | |||
96 | userFolders.Add(rootFolder); | ||
97 | |||
98 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | ||
99 | { | ||
100 | IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.folderID); | ||
101 | userFolders.AddRange(folders); | ||
102 | } | ||
103 | |||
104 | // foreach (InventoryFolderBase folder in userFolders) | ||
105 | // { | ||
106 | // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); | ||
107 | // } | ||
108 | |||
109 | return userFolders; | ||
110 | } | ||
111 | catch (Exception e) | ||
112 | { | ||
113 | m_log.ErrorFormat("GetInventorySkeleton() exception {0}", e); | ||
114 | } | ||
99 | 115 | ||
100 | return userFolders; | 116 | return null; |
101 | } | 117 | } |
102 | 118 | ||
103 | // See IInventoryServices | 119 | // See IInventoryServices |