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.
0.8.2-post-fixes
Melanie Thielker 2015-08-19 01:19:25 +02:00
parent 62f3399559
commit 25335b0707
1 changed files with 6 additions and 0 deletions

View File

@ -403,6 +403,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected virtual void Sleep(int delay) 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); m_ScriptEngine.SleepScript(m_item.ItemID, delay);
} }