From a432a07005c700222de612f408fe2921d2348825 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 21 Jul 2008 13:40:08 +0000 Subject: Mantis#1798. Thank you kindly, StrawberryFride for a patch that: Fixes a couple of places where null reference exceptions were being caught and ignored rather than null checks being performed. --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 57d3e5c..399cbf6 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -95,22 +95,14 @@ namespace OpenSim.Region.Environment.Scenes // If we're not doing the initial set // Then we've got to remove the previous // event handler - try - { + + if (_PhyScene != null) _PhyScene.OnPhysicsCrash -= physicsBasedCrash; - } - catch (NullReferenceException) - { - // This occurs when storing to _PhyScene the first time. - // Is there a better way to check the event handler before - // getting here - // This can be safely ignored. We're setting the first inital - // there are no event handler's registered. - } _PhyScene = value; - _PhyScene.OnPhysicsCrash += physicsBasedCrash; + if (_PhyScene != null) + _PhyScene.OnPhysicsCrash += physicsBasedCrash; } } -- cgit v1.1