mirror of
https://github.com/opensim/opensim.git
synced 2026-07-14 19:55:35 +08:00
This patch fixes mantis 105. Basically, it stops the index exception when
no root folder is found and it makes the user server wait longer for the inventory server to do its work. From Justin Casey (IBM)
This commit is contained in:
@@ -211,11 +211,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the users inventory root folder.
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
// see InventoryItemBase.getUserRootFolder
|
||||
public InventoryFolderBase getUserRootFolder(LLUUID user)
|
||||
{
|
||||
try
|
||||
@@ -234,9 +230,19 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
List<InventoryFolderBase> items = new List<InventoryFolderBase>();
|
||||
while (reader.Read())
|
||||
items.Add(readInventoryFolder(reader));
|
||||
|
||||
InventoryFolderBase rootFolder = null;
|
||||
|
||||
// There should only ever be one root folder for a user. However, if there's more
|
||||
// than one we'll simply use the first one rather than failing. It would be even
|
||||
// nicer to print some message to this effect, but this feels like it's too low a
|
||||
// to put such a message out, and it's too minor right now to spare the time to
|
||||
// suitably refactor.
|
||||
if (items.Count > 0)
|
||||
{
|
||||
rootFolder = items[0];
|
||||
}
|
||||
|
||||
InventoryFolderBase rootFolder = items[0];
|
||||
//should only be one folder with parent set to zero (the root one).
|
||||
reader.Close();
|
||||
result.Dispose();
|
||||
|
||||
@@ -252,7 +258,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of folders in a users inventory contained within the specified folder
|
||||
/// Return a list of folders in a users inventory contained within the specified folder.
|
||||
/// This method is only used in tests - in normal operation the user always have one,
|
||||
/// and only one, root folder.
|
||||
/// </summary>
|
||||
/// <param name="parentID">The folder to search</param>
|
||||
/// <returns>A list of inventory folders</returns>
|
||||
@@ -605,4 +613,4 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user