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) public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
{ {
Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); if (!this.InventoryFolders.ContainsKey(folderID))
InventoryFolder Folder = new InventoryFolder(); {
Folder.FolderID = folderID; Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
Folder.OwnerID = this.AgentID; InventoryFolder Folder = new InventoryFolder();
Folder.DefaultType = type; Folder.FolderID = folderID;
Folder.FolderName = folderName; Folder.OwnerID = this.AgentID;
Folder.ParentID = parent; Folder.DefaultType = type;
this.InventoryFolders.Add(Folder.FolderID, Folder); Folder.FolderName = folderName;
Folder.ParentID = parent;
this.InventoryFolders.Add(Folder.FolderID, Folder);
}
return (true); return (true);
} }