Prevent a bad cast in llCreateLink().

prebuild-update
Melanie Thielker 2010-08-18 20:17:20 +02:00 committed by Melanie
parent a8c0b131f9
commit 6ddf124c8a
1 changed files with 5 additions and 1 deletions

View File

@ -3505,6 +3505,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID invItemID = InventorySelf(); UUID invItemID = InventorySelf();
UUID targetID;
if (!UUID.TryParse(target, out targetID))
return;
TaskInventoryItem item; TaskInventoryItem item;
lock (m_host.TaskInventory) lock (m_host.TaskInventory)
@ -3524,7 +3528,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (sp != null) if (sp != null)
client = sp.ControllingClient; client = sp.ControllingClient;
SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID);
if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0)
return; // Fail silently if attached return; // Fail silently if attached