From 8e00e933a47c583e1016dd164e50c49d4db57167 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 22 Sep 2008 20:09:06 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2234 * Exceptions can thrown by llGetOwnerKey() * Thanks idb --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 679b9b8..90cd3b1 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -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 { -- cgit v1.1