diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index b7df84da69..6ecc0c80d2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -111,6 +111,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP { lock (SyncRoot) { + if (packets.Count == 0) + return null; + using (SortedDictionary.ValueCollection.Enumerator e = packets.Values.GetEnumerator()) return e.Current; } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 3c91b29e7f..9806218497 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs @@ -129,10 +129,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public void AddRegion(Scene Sceneworld) { - m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing"); - - m_Scene = Sceneworld; - // Make sure we have config if (ConfigSource.Configs[ScriptEngineName] == null) ConfigSource.AddConfig(ScriptEngineName); @@ -143,6 +139,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (!m_enabled) return; + m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing"); + + m_Scene = Sceneworld; + // Create all objects we'll be using m_EventQueueManager = new EventQueueManager(this); m_EventManager = new EventManager(this, true);