From 8f26427055eaa72197b38f450c47cd95ad3463c2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 11 May 2008 13:30:47 +0000 Subject: * Fixed null reference exception when rezzing an object from inventory with a rootpart that isn't found. Added a way to tell if it's an attachment. --- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 29bcf0b..782d5b4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1308,7 +1308,20 @@ namespace OpenSim.Region.Environment.Scenes group.SetFromAssetID(itemID); } - SceneObjectPart rootPart = group.GetChildPart(group.UUID); + SceneObjectPart rootPart = null; + try + { + rootPart = group.GetChildPart(group.UUID); + } + catch (NullReferenceException) + { + string isAttachment = ""; + + if (attachment) + isAttachment = " Object was an attachment"; + + m_log.Error("[OJECTREZ]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); + } // Since renaming the item in the inventory does not affect the name stored // in the serialization, transfer the correct name from the inventory to the -- cgit v1.1