diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 144d762946..adc8d989a7 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -4059,8 +4059,11 @@ namespace OpenSim.Region.PhysicsModule.ODE { _worldInitialized = false; - m_rayCastManager.Dispose(); - m_rayCastManager = null; + if (m_rayCastManager != null) + { + m_rayCastManager.Dispose(); + m_rayCastManager = null; + } lock (OdeLock) {