diff options
author | Oren Hurvitz | 2012-10-21 15:58:01 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-02 00:04:14 +0000 |
commit | a0739a80a89f5f89f3d95a0338cb9f833fee09a5 (patch) | |
tree | 7c3f6a6d87b63a79ada68c30d850508bf4864c76 /OpenSim/Services | |
parent | minor: Assign names to the different SmartThreadPools for debugging purposes. (diff) | |
download | opensim-SC_OLD-a0739a80a89f5f89f3d95a0338cb9f833fee09a5.zip opensim-SC_OLD-a0739a80a89f5f89f3d95a0338cb9f833fee09a5.tar.gz opensim-SC_OLD-a0739a80a89f5f89f3d95a0338cb9f833fee09a5.tar.bz2 opensim-SC_OLD-a0739a80a89f5f89f3d95a0338cb9f833fee09a5.tar.xz |
Fixed bugs when getting the root folder.
1. The error checking for the case where there's no "My Inventory" folder was
incorrect: it checked the wrong variable.
2. If GetSystemFolderForType() is called to get AssetType.RootFolder then
it should return the root folder immediately; not look for another root
folder below it.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 00faa44..7bad4b0 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -219,9 +219,15 @@ namespace OpenSim.Services.InventoryService | |||
219 | 219 | ||
220 | XInventoryFolder root = null; | 220 | XInventoryFolder root = null; |
221 | foreach (XInventoryFolder folder in folders) | 221 | foreach (XInventoryFolder folder in folders) |
222 | { | ||
222 | if (folder.folderName == "My Inventory") | 223 | if (folder.folderName == "My Inventory") |
224 | { | ||
223 | root = folder; | 225 | root = folder; |
224 | if (folders == null) // oops | 226 | break; |
227 | } | ||
228 | } | ||
229 | |||
230 | if (root == null) // oops | ||
225 | root = folders[0]; | 231 | root = folders[0]; |
226 | 232 | ||
227 | return ConvertToOpenSim(root); | 233 | return ConvertToOpenSim(root); |
@@ -249,6 +255,9 @@ namespace OpenSim.Services.InventoryService | |||
249 | { | 255 | { |
250 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); | 256 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); |
251 | 257 | ||
258 | if (type == AssetType.RootFolder) | ||
259 | return rootFolder; | ||
260 | |||
252 | XInventoryFolder[] folders = m_Database.GetFolders( | 261 | XInventoryFolder[] folders = m_Database.GetFolders( |
253 | new string[] { "agentID", "parentFolderID", "type"}, | 262 | new string[] { "agentID", "parentFolderID", "type"}, |
254 | new string[] { rootFolder.Owner.ToString(), rootFolder.ID.ToString(), ((int)type).ToString() }); | 263 | new string[] { rootFolder.Owner.ToString(), rootFolder.ID.ToString(), ((int)type).ToString() }); |