From 1582e05ac78ac46708de84f5d35f79c935febd5b Mon Sep 17 00:00:00 2001 From: meta7 Date: Tue, 10 Aug 2010 09:55:40 -0700 Subject: Fix a nullref issue in the AgentSetAppearance packet handler when removing the physactor from the scene --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3154872..4064339 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1090,12 +1090,17 @@ namespace OpenSim.Region.Framework.Scenes { if (PhysicsActor != null) { - m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; - m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; - m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); - m_physicsActor.UnSubscribeEvents(); - m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; - PhysicsActor = null; + try + { + m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; + m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; + m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); + m_physicsActor.UnSubscribeEvents(); + PhysicsActor = null; + } + catch + { } } } -- cgit v1.1