diff options
author | Melanie | 2012-06-07 00:24:07 +0200 |
---|---|---|
committer | Melanie | 2012-06-07 00:24:07 +0200 |
commit | 5876a4d392f4f1742325c65e52e7201e0f43108b (patch) | |
tree | b6d560c2f5fb28944cc09b27e8b2edb22b4454ed | |
parent | fix the real cause of double velocity (diff) | |
download | opensim-SC-5876a4d392f4f1742325c65e52e7201e0f43108b.zip opensim-SC-5876a4d392f4f1742325c65e52e7201e0f43108b.tar.gz opensim-SC-5876a4d392f4f1742325c65e52e7201e0f43108b.tar.bz2 opensim-SC-5876a4d392f4f1742325c65e52e7201e0f43108b.tar.xz |
Prevent a null ref when getting the velocity of an avatar during login or
logout.
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files 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 | |||
2536 | { | 2536 | { |
2537 | m_host.AddScriptLPS(1); | 2537 | m_host.AddScriptLPS(1); |
2538 | 2538 | ||
2539 | Vector3 vel; | 2539 | Vector3 vel = Vector3.Zero; |
2540 | 2540 | ||
2541 | if (m_host.ParentGroup.IsAttachment) | 2541 | if (m_host.ParentGroup.IsAttachment) |
2542 | { | 2542 | { |
2543 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); | 2543 | ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar); |
2544 | vel = avatar.Velocity; | 2544 | if (avatar != null) |
2545 | vel = avatar.Velocity; | ||
2545 | } | 2546 | } |
2546 | else | 2547 | else |
2547 | { | 2548 | { |