From: Christopher Yeoh <cyeoh@au1.ibm.com>

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.
This commit is contained in:
Dr Scofield
2008-12-03 10:10:01 +00:00
parent 0d5d3e0b48
commit 59b0ac846c

View File

@@ -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