aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2015-08-19 01:19:25 +0200
committerMelanie Thielker2015-08-19 01:19:25 +0200
commit25335b07072ccfd8ed68b726efb8ecb678f0c153 (patch)
tree8f1554c7fb8127219f2bb039c88ef4e4629b2349
parentTry to address Mantis #7689. When adding a scalar to a list, make a copy (diff)
downloadopensim-SC_OLD-25335b07072ccfd8ed68b726efb8ecb678f0c153.zip
opensim-SC_OLD-25335b07072ccfd8ed68b726efb8ecb678f0c153.tar.gz
opensim-SC_OLD-25335b07072ccfd8ed68b726efb8ecb678f0c153.tar.bz2
opensim-SC_OLD-25335b07072ccfd8ed68b726efb8ecb678f0c153.tar.xz
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.
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index f364032..399c6e4 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
403 403
404 protected virtual void Sleep(int delay) 404 protected virtual void Sleep(int delay)
405 { 405 {
406 if (m_item == null) // Some unit tests don't set this
407 {
408 Thread.Sleep(delay);
409 return;
410 }
411
406 m_ScriptEngine.SleepScript(m_item.ItemID, delay); 412 m_ScriptEngine.SleepScript(m_item.ItemID, delay);
407 } 413 }
408 414