From ed846f11f17b7497c9a0bcf599fcb6431504c18e Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 2 Feb 2012 18:06:34 -0800
Subject: OpenSim tests do not always create an EventManager so calls to
 trigger events during tests must check for null EventManager

---
 OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9b660b6..9fb11d3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2729,7 +2729,9 @@ namespace OpenSim.Region.Framework.Scenes
             if (ParentGroup == null)
                 return;
 
-            ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
+            // When running OpenSim tests, EventManager can be null. Maybe tests should create an EventManager.
+            if(ParentGroup.Scene.EventManager != null)
+                ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
 
             ParentGroup.QueueForUpdateCheck();
 
@@ -2763,7 +2765,9 @@ namespace OpenSim.Region.Framework.Scenes
             if (ParentGroup == null)
                 return;
 
-            ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
+            // When running OpenSim tests, EventManager can be null. Maybe tests should create an EventManager.
+            if (ParentGroup.Scene.EventManager != null)
+                ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
 
             // This was pulled from SceneViewer. Attachments always receive full updates.
             // I could not verify if this is a requirement but this maintains existing behavior
-- 
cgit v1.1