From cbda7281837d47643b6975dd296b2cfcbc825eaa Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 8 Nov 2008 20:31:47 +0000 Subject: * "Fixed" a NRE with the new script engine Tedd committed * Tedd will need to fix properly. --- .../ScriptEngine/RegionEngineLoader.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'OpenSim/ApplicationPlugins/ScriptEngine') diff --git a/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs b/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs index 115d237..1023238 100644 --- a/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs +++ b/OpenSim/ApplicationPlugins/ScriptEngine/RegionEngineLoader.cs @@ -54,16 +54,22 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine // New region is being created // Create a new script engine // Make sure we have config - if (ConfigSource.Configs["SECS"] == null) - ConfigSource.AddConfig("SECS"); - ScriptConfigSource = ConfigSource.Configs["SECS"]; + try + { + if (ConfigSource.Configs["SECS"] == null) + ConfigSource.AddConfig("SECS"); + ScriptConfigSource = ConfigSource.Configs["SECS"]; - // Is SECS enabled? - if (ScriptConfigSource.GetBoolean("Enabled", false)) + // Is SECS enabled? + if (ScriptConfigSource.GetBoolean("Enabled", false)) + { + LoadEngine(); + if (scriptEngine != null) + scriptEngine.Initialise(scene, source); + } + } + catch (NullReferenceException) { - LoadEngine(); - if (scriptEngine != null) - scriptEngine.Initialise(scene, source); } } -- cgit v1.1