From 25335b07072ccfd8ed68b726efb8ecb678f0c153 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 19 Aug 2015 01:19:25 +0200 Subject: [PATCH] Some unit tests are simply broken and create an API with a null m_item. This isn't supposed to be done and should be changed in the tests. For now, add a protective check. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f364032fd5..399c6e4830 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -403,6 +403,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected virtual void Sleep(int delay) { + if (m_item == null) // Some unit tests don't set this + { + Thread.Sleep(delay); + return; + } + m_ScriptEngine.SleepScript(m_item.ItemID, delay); }