From b02db11c6990986a65e6790b5520b15d1c47e51e Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Jun 2012 20:38:42 +0200 Subject: Remove a null ref when an avatar's attachment gets the avatar velocity while the avatar is logging in or out. Also remove some unlocking calls without matching locking call. Merge artefact cleanup, again. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5905958..e0b24dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2498,12 +2498,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 { @@ -10401,7 +10402,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ShoutError("No permissions to track the camera"); return new LSL_Vector(); } - m_host.TaskInventory.LockItemsForRead(false); // ScenePresence presence = World.GetScenePresence(m_host.OwnerID); ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); @@ -10425,7 +10425,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ShoutError("No permissions to track the camera"); return new LSL_Rotation(); } - m_host.TaskInventory.LockItemsForRead(false); // ScenePresence presence = World.GetScenePresence(m_host.OwnerID); ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); -- cgit v1.1