From 59b0ac846c52dc8fb56f37a1d0ab18a7f27ba6aa Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 3 Dec 2008 10:10:01 +0000 Subject: From: Christopher Yeoh The attached patch fixes the bug where llCreateLink will cause a null dereference if the avatar who gave link permission for the object is no longer logged in. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f748522..52e7288 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3028,7 +3028,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); return; } - IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; + IClientAPI client = null; + ScenePresence sp = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); + if (sp!=null) + client = sp.ControllingClient; SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) return; // Fail silently if attached -- cgit v1.1