Put guards on a bunch of exception-inducing code, as seen in logs from load test.

This commit is contained in:
Diva Canto
2013-07-09 14:12:52 -07:00
parent b2d4b8b1da
commit 67e500383e
6 changed files with 20 additions and 6 deletions

View File

@@ -3687,7 +3687,9 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
sp.Name, sp.UUID, RegionInfo.RegionName);
sp.ControllingClient.Close(true);
if (sp.ControllingClient != null)
sp.ControllingClient.Close(true);
sp = null;
}

View File

@@ -67,6 +67,12 @@ namespace OpenSim.Region.Framework.Scenes
{
int scriptsStarted = 0;
if (m_scene == null)
{
m_log.DebugFormat("[PRIM INVENTORY]: m_scene is null. Unable to create script instances");
return 0;
}
// Don't start scripts if they're turned off in the region!
if (!m_scene.RegionInfo.RegionSettings.DisableScripts)
{

View File

@@ -553,7 +553,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void StopScriptInstance(TaskInventoryItem item)
{
m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID);
if (m_part.ParentGroup.Scene != null)
m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID);
// At the moment, even stopped scripts are counted as active, which is probably wrong.
// m_part.ParentGroup.AddActiveScriptCount(-1);