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.
iar_mods
Justin Clark-Casey (justincc) 2012-01-31 20:30:30 +00:00
parent f3780b9eae
commit 10b9348071
1 changed files with 7 additions and 1 deletions

View File

@ -353,8 +353,14 @@ namespace OpenSim.Region.Framework.Scenes
/// </returns> /// </returns>
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) 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; return false;
}
if (Entities.ContainsKey(sceneObject.UUID)) if (Entities.ContainsKey(sceneObject.UUID))
{ {