diff options
author | UbitUmarov | 2018-06-09 20:44:38 +0100 |
---|---|---|
committer | UbitUmarov | 2018-06-09 20:45:05 +0100 |
commit | 76a82ba5de299ee37490db396a0b9b3eae53cbf9 (patch) | |
tree | 3d2c3bd4d8cc4c6d660843b0367a8745264afbf4 | |
parent | Yengine apply a fix to CheckRunLockInvariants by mrieker (diff) | |
download | opensim-SC-76a82ba5de299ee37490db396a0b9b3eae53cbf9.zip opensim-SC-76a82ba5de299ee37490db396a0b9b3eae53cbf9.tar.gz opensim-SC-76a82ba5de299ee37490db396a0b9b3eae53cbf9.tar.bz2 opensim-SC-76a82ba5de299ee37490db396a0b9b3eae53cbf9.tar.xz |
improve llOverMyLand() handling of potencial null refs. ty mrieker
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9799886..47610a1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6896,22 +6896,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6896 | UUID key = new UUID(); | 6896 | UUID key = new UUID(); |
6897 | if (UUID.TryParse(id, out key)) | 6897 | if (UUID.TryParse(id, out key)) |
6898 | { | 6898 | { |
6899 | ScenePresence presence = World.GetScenePresence(key); | 6899 | try |
6900 | if (presence != null) // object is an avatar | ||
6901 | { | ||
6902 | if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) | ||
6903 | return 1; | ||
6904 | } | ||
6905 | else // object is not an avatar | ||
6906 | { | 6900 | { |
6907 | SceneObjectPart obj = World.GetSceneObjectPart(key); | 6901 | ScenePresence presence = World.GetScenePresence(key); |
6908 | 6902 | if (presence != null) // object is an avatar | |
6909 | if (obj != null) | ||
6910 | { | 6903 | { |
6911 | if (m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID) | 6904 | if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) |
6912 | return 1; | 6905 | return 1; |
6913 | } | 6906 | } |
6907 | else // object is not an avatar | ||
6908 | { | ||
6909 | SceneObjectPart obj = World.GetSceneObjectPart(key); | ||
6910 | |||
6911 | if (obj != null && | ||
6912 | m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID) | ||
6913 | return 1; | ||
6914 | } | ||
6914 | } | 6915 | } |
6916 | catch { } | ||
6915 | } | 6917 | } |
6916 | 6918 | ||
6917 | return 0; | 6919 | return 0; |
@@ -14780,7 +14782,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14780 | return; | 14782 | return; |
14781 | } | 14783 | } |
14782 | 14784 | ||
14783 | string data = Encoding.UTF8.GetString(a.Data); | 14785 | //string data = Encoding.UTF8.GetString(a.Data); |
14784 | //m_log.Debug(data); | 14786 | //m_log.Debug(data); |
14785 | NotecardCache.Cache(id, a.Data); | 14787 | NotecardCache.Cache(id, a.Data); |
14786 | AsyncCommands.DataserverPlugin.DataserverReply( | 14788 | AsyncCommands.DataserverPlugin.DataserverReply( |