From bfce5d75d5923272e901581bd7e5a1355db7bd0e Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 11 Sep 2019 22:36:30 +1000 Subject: Hack around some tests failing. Fix the tests later. --- .../Shared/Api/Implementation/OSSL_Api.cs | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a8c1a8f..fb58850 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -274,15 +274,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // or a string explaining why this function can't be used. private string CheckThreatLevelTest(ThreatLevel level, string function) { - // Grid gods can do anything they damn well please. - if (World.Permissions.IsGridGod(m_item.OwnerID)) - return String.Empty; - else - { - // So can active gods. - ScenePresence sp = World.GetScenePresence(m_item.OwnerID); - if (sp != null && !sp.IsDeleted && sp.IsGod) - return String.Empty; + // This test is coz the test system manages to call scripts without having them in items. + //// TODO - fix up the test system. + if ((null != m_item) && (null != m_item.OwnerID)) + { + // Grid gods can do anything they damn well please. + if (World.Permissions.IsGridGod(m_item.OwnerID)) + { + return String.Empty; + } + else + { + // So can active gods. + ScenePresence sp = World.GetScenePresence(m_item.OwnerID); + if (sp != null && !sp.IsDeleted && sp.IsGod) + return String.Empty; + } } if (!m_FunctionPerms.ContainsKey(function)) -- cgit v1.1