From 5876a4d392f4f1742325c65e52e7201e0f43108b Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 00:24:07 +0200 Subject: Prevent a null ref when getting the velocity of an avatar during login or logout. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d83b05d..a51c625 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2536,12 +2536,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - Vector3 vel; + Vector3 vel = Vector3.Zero; if (m_host.ParentGroup.IsAttachment) { ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); - vel = avatar.Velocity; + if (avatar != null) + vel = avatar.Velocity; } else { -- cgit v1.1