diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 73ffc5e..3c3534f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -145,6 +145,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
145 | m_InventoryCache.Remove(userID); | 145 | m_InventoryCache.Remove(userID); |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | ||
149 | /// Get the system folder for a particular asset type | ||
150 | /// </summary> | ||
151 | /// <param name="userID"></param> | ||
152 | /// <param name="type"></param> | ||
153 | /// <returns></returns> | ||
148 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 154 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) |
149 | { | 155 | { |
150 | Dictionary<AssetType, InventoryFolderBase> folders = null; | 156 | Dictionary<AssetType, InventoryFolderBase> folders = null; |
@@ -152,6 +158,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
152 | lock (m_InventoryCache) | 158 | lock (m_InventoryCache) |
153 | { | 159 | { |
154 | m_InventoryCache.TryGetValue(userID, out folders); | 160 | m_InventoryCache.TryGetValue(userID, out folders); |
161 | |||
162 | // In some situations (such as non-secured standalones), system folders can be requested without | ||
163 | // the user being logged in. So we need to try caching them here if we don't already have them. | ||
164 | if (null == folders) | ||
165 | CacheSystemFolders(userID); | ||
166 | |||
167 | m_InventoryCache.TryGetValue(userID, out folders); | ||
155 | } | 168 | } |
156 | 169 | ||
157 | if ((folders != null) && folders.ContainsKey(type)) | 170 | if ((folders != null) && folders.ContainsKey(type)) |