Prevent a null reference when giving items.

This commit is contained in:
Melanie Thielker
2008-11-21 00:54:32 +00:00
parent d262a9adbf
commit 0092ecbce7

View File

@@ -152,6 +152,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
new UUID(im.toAgentID),
client.AgentId, itemID);
if (itemCopy == null)
{
client.SendAgentAlertMessage("Can't find item to give. Nothing given.", false);
return;
}
byte[] itemCopyID = itemCopy.ID.GetBytes();
Array.Copy(itemCopyID, 0, im.binaryBucket, 1, 16);