diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 900b19ce2f..2c6ab2ee6b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -376,6 +376,17 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = GetSceneObjectPart(primID); SceneObjectGroup group = part.ParentGroup; + + if (null == group) + { + m_log.ErrorFormat( + "[PRIM INVENTORY]: " + + "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist", + itemID, primID); + + return new ArrayList(); + } + if (isScriptRunning) { m_log.Debug("To RemoveScriptInstance"); @@ -385,6 +396,16 @@ namespace OpenSim.Region.Framework.Scenes // Retrieve item TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemID); + if (null == item) + { + m_log.ErrorFormat( + "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " + + " but the item does not exist in this inventory", + itemID, part.Name, part.UUID); + + return new ArrayList(); + } + // Update item with new asset item.AssetID = newAssetID; group.UpdateInventoryItem(item); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 7a0cc5a8fe..d3d2d73979 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -539,6 +539,9 @@ namespace OpenSim.Region.Framework.Scenes //m_inventorySerial += 2; HasInventoryChanged = true; m_part.ParentGroup.HasGroupChanged = true; + + //SYMMETRIC SYNC: add ScheduleFullUpdate to enable synchronization across actors + m_part.ScheduleFullUpdate(); } ///