From 616e672fce793350071bff538db4a8dc033f6259 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Sep 2011 02:43:17 +0100 Subject: 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 --- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index b4f69e6..f46d9f7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -208,9 +208,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); if (user != null) - { user.ControllingClient.SendBulkUpdateInventory(folderCopy); - } // HACK!! im.imSessionID = folderID.Guid; @@ -240,9 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); if (user != null) - { user.ControllingClient.SendBulkUpdateInventory(itemCopy); - } // HACK!! im.imSessionID = itemID.Guid; @@ -288,7 +284,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer 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); }); } } -- cgit v1.1