From 10b9348071094122d5e2dd636f7cce9c0b25f0a9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 31 Jan 2012 20:30:30 +0000 Subject: Remove scene object null check on SceneGraph.AddSceneObject(). Complain explicitly if there's an attempt to add any object with a zero UUID. Callers themselves need to check that they're not attempting to add a null scene object. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 006f9c6..06de72f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -353,8 +353,14 @@ namespace OpenSim.Region.Framework.Scenes /// protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) { - if (sceneObject == null || sceneObject.RootPart.UUID == UUID.Zero) + if (sceneObject.UUID == UUID.Zero) + { + m_log.ErrorFormat( + "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}", + sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero); + return false; + } if (Entities.ContainsKey(sceneObject.UUID)) { -- cgit v1.1