From 1f28c6208be1b3be1acca69f0ac8056d0ceecc06 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Fri, 16 Oct 2009 03:40:44 -0400 Subject: [PATCH] * Added a message for when the null reference exception occurs to make debugging easier. Without this, from the user's perspective.. they cannot move, fly or otherwise do anything physical and without a message on the console, it would be hard to tell that this is what is occurring. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd05c9209b..e5458d4156 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1109,12 +1109,13 @@ namespace OpenSim.Region.Physics.OdePlugin try { vec = d.BodyGetPosition(Body); - //throw new NullReferenceException("foo!"); + } catch (NullReferenceException) { - vec = new d.Vector3(Position.X, Position.Y, Position.Z); - base.RaiseOutOfBounds(_position); + vec = new d.Vector3(_position.X, _position.Y, _position.Z); + base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! + m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); }