Try to cache system folders if they aren't already there when one is requested
This operation can be performed legitimately on standalones without a logged in userremotes/origin/0.6.7-post-fixes
parent
7ff4c2e50b
commit
18c5dc0953
|
@ -145,6 +145,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
m_InventoryCache.Remove(userID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the system folder for a particular asset type
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
Dictionary<AssetType, InventoryFolderBase> folders = null;
|
||||
|
@ -152,6 +158,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
lock (m_InventoryCache)
|
||||
{
|
||||
m_InventoryCache.TryGetValue(userID, out folders);
|
||||
|
||||
// In some situations (such as non-secured standalones), system folders can be requested without
|
||||
// the user being logged in. So we need to try caching them here if we don't already have them.
|
||||
if (null == folders)
|
||||
CacheSystemFolders(userID);
|
||||
|
||||
m_InventoryCache.TryGetValue(userID, out folders);
|
||||
}
|
||||
|
||||
if ((folders != null) && folders.ContainsKey(type))
|
||||
|
|
Loading…
Reference in New Issue