diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 1ad543b75a..5c7a3dfd46 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -587,6 +587,15 @@ namespace OpenSim.Capabilities.Handlers
AddLibraryFolders(fetchFolders, result);
+ // Filter folder Zero right here. Some viewers (Firestorm) send request for folder Zero, which doesn't make sense
+ // and can kill the sim (all root folders have parent_id Zero)
+ LLSDFetchInventoryDescendents zero = fetchFolders.Find(f => f.folder_id == UUID.Zero);
+ if (zero != null)
+ {
+ fetchFolders.Remove(zero);
+ BadFolder(zero, null, bad_folders);
+ }
+
if (fetchFolders.Count > 0)
{
UUID[] fids = new UUID[fetchFolders.Count];
@@ -600,7 +609,9 @@ namespace OpenSim.Capabilities.Handlers
if (fetchedContents == null || (fetchedContents != null && fetchedContents.Length == 0))
{
- //m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Could not get contents of multiple folders for user {0}", fetchFolders[0].owner_id);
+ m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Could not get contents of multiple folders for user {0}", fetchFolders[0].owner_id);
+ foreach (LLSDFetchInventoryDescendents freq in fetchFolders)
+ BadFolder(freq, null, bad_folders);
return null;
}
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
index 380c54a386..0b66835c48 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
@@ -262,6 +262,31 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
count = Regex.Matches(llsdresponse, notecards_folder).Count;
Assert.AreEqual(2, count, "More than 1 notecards folder in response"); // Notecards will also be under root, so 2
}
+
+ [Test]
+ public void Test_005_FolderZero()
+ {
+ TestHelpers.InMethod();
+
+ Init();
+
+ FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene);
+ TestOSHttpRequest req = new TestOSHttpRequest();
+ TestOSHttpResponse resp = new TestOSHttpResponse();
+
+ string request = "";
+
+ string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp);
+
+ Assert.That(llsdresponse != null, Is.True, "Incorrect null response");
+ Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response");
+ Assert.That(llsdresponse.Contains("bad_folders00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder");
+
+ Console.WriteLine(llsdresponse);
+ }
+
}
}
\ No newline at end of file