Guard against re-adding an existing folder. Seemed to happen on some timeout cases.

zircon^2
morphw 2007-05-11 19:24:09 +00:00
parent f016e8675b
commit b865249b8c
1 changed files with 11 additions and 8 deletions

View File

@ -77,14 +77,17 @@ namespace OpenSim.Framework.Inventory
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
{
Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
InventoryFolder Folder = new InventoryFolder();
Folder.FolderID = folderID;
Folder.OwnerID = this.AgentID;
Folder.DefaultType = type;
Folder.FolderName = folderName;
Folder.ParentID = parent;
this.InventoryFolders.Add(Folder.FolderID, Folder);
if (!this.InventoryFolders.ContainsKey(folderID))
{
Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
InventoryFolder Folder = new InventoryFolder();
Folder.FolderID = folderID;
Folder.OwnerID = this.AgentID;
Folder.DefaultType = type;
Folder.FolderName = folderName;
Folder.ParentID = parent;
this.InventoryFolders.Add(Folder.FolderID, Folder);
}
return (true);
}