mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user