From 0855066968e30a9965088c14234b2bc93daf0481 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Sat, 8 Dec 2007 14:27:12 +0000 Subject: 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) --- OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs') diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs index 364e0f2..cd0470c 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs @@ -201,11 +201,7 @@ namespace OpenSim.Framework.Data.MSSQL } } - /// - /// Returns the users inventory root folder. - /// - /// - /// + // see InventoryItemBase.getUserRootFolder public InventoryFolderBase getUserRootFolder(LLUUID user) { try @@ -224,8 +220,14 @@ namespace OpenSim.Framework.Data.MSSQL 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]; //should only be one folder with parent set to zero (the root one). + rootFolder = items[0]; } reader.Close(); @@ -694,4 +696,4 @@ namespace OpenSim.Framework.Data.MSSQL } } } -} \ No newline at end of file +} -- cgit v1.1