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) --- .../Framework/Data.SQLite/SQLiteInventoryStore.cs | 27 +++++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework/Data.SQLite') diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index 5e95878..94084a6 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs @@ -226,11 +226,7 @@ namespace OpenSim.Framework.Data.SQLite return new List(); } - /// - /// Returns the users inventory root folder. - /// - /// The UUID of the user who is having inventory being returned - /// Root inventory folder + // see InventoryItemBase.getUserRootFolder public InventoryFolderBase getUserRootFolder(LLUUID user) { List folders = new List(); @@ -242,22 +238,15 @@ namespace OpenSim.Framework.Data.SQLite folders.Add(buildFolder(row)); } - if (folders.Count == 1) + // 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 (folders.Count > 1) { - //we found the root - //System.Console.WriteLine("found root inventory folder"); return folders[0]; } - else if (folders.Count > 1) - { - //err shouldn't be more than one root - //System.Console.WriteLine("found more than one root inventory folder"); - } - else if (folders.Count == 0) - { - // no root? - //System.Console.WriteLine("couldn't find root inventory folder"); - } return null; } @@ -608,4 +597,4 @@ namespace OpenSim.Framework.Data.SQLite return true; } } -} \ No newline at end of file +} -- cgit v1.1