* Exceptions can thrown by llGetOwnerKey() 
* Thanks idb
0.6.0-stable
Justin Clarke Casey 2008-09-22 20:09:06 +00:00
parent c64551710e
commit 8e00e933a4
2 changed files with 24 additions and 2 deletions

View File

@ -3957,7 +3957,18 @@ namespace OpenSim.Region.ScriptEngine.Common
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString();
try
{
SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId);
if (obj == null)
return id; // the key is for an agent so just return the key
else
return obj.OwnerID.ToString();
}
catch (KeyNotFoundException)
{
return id; // The Object/Agent is not in the region so just return the key
}
}
else
{

View File

@ -3815,7 +3815,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
return World.GetSceneObjectPart(World.Entities[key].LocalId).OwnerID.ToString();
try
{
SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId);
if (obj == null)
return id; // the key is for an agent so just return the key
else
return obj.OwnerID.ToString();
}
catch (KeyNotFoundException)
{
return id; // The Object/Agent not in the region so just return the key
}
}
else
{