If the user receiving an inventory folder has left the scene by the time the acceptence message arrives, then don't send them an inventory update.

Doing so causes a NullReferenceException
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-01 02:43:17 +01:00
parent c491cdcb95
commit 616e672fce
1 changed files with 4 additions and 5 deletions

View File

@ -208,9 +208,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
if (user != null) if (user != null)
{
user.ControllingClient.SendBulkUpdateInventory(folderCopy); user.ControllingClient.SendBulkUpdateInventory(folderCopy);
}
// HACK!! // HACK!!
im.imSessionID = folderID.Guid; im.imSessionID = folderID.Guid;
@ -240,9 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16);
if (user != null) if (user != null)
{
user.ControllingClient.SendBulkUpdateInventory(itemCopy); user.ControllingClient.SendBulkUpdateInventory(itemCopy);
}
// HACK!! // HACK!!
im.imSessionID = itemID.Guid; im.imSessionID = itemID.Guid;
@ -288,7 +284,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
fromUser.ControllingClient.SendBulkUpdateInventory(folder); // If the user has left the scene by the time the message comes back then we can't send
// them the update.
if (fromUser != null)
fromUser.ControllingClient.SendBulkUpdateInventory(folder);
}); });
} }
} }