Move client id check in Scene.Inventory.cs:UpdateInventoryItemAsset so that it doesn't trigger an exception if the item hasn't been found.

In this situation we will now put out a slightly more meaningful log error message instead.
iar_mods
Justin Clark-Casey (justincc) 2011-12-09 22:36:51 +00:00
parent 4e9f50b878
commit 94c242f792
1 changed files with 6 additions and 4 deletions

View File

@ -337,11 +337,12 @@ namespace OpenSim.Region.Framework.Scenes
// Passing something to another avatar or a an object will already
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item.Owner != remoteClient.AgentId)
return;
if (item != null)
{
if (item.Owner != remoteClient.AgentId)
return;
if (UUID.Zero == transactionID)
{
item.Name = itemUpd.Name;
@ -388,8 +389,9 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
m_log.Error(
"[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
m_log.ErrorFormat(
"[AGENTINVENTORY]: Item id {0} not found for an inventory item update for {1}.",
itemID, remoteClient.Name);
}
}