diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 6964490b0d..162f323f96 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -644,12 +644,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools sfs.Close(); string posmap = String.Empty; - foreach (KeyValuePair, KeyValuePair> kvp in m_positionMap) + if (m_positionMap != null) { - KeyValuePair k = kvp.Key; - KeyValuePair v = kvp.Value; - posmap += String.Format("{0},{1},{2},{3}\n", - k.Key, k.Value, v.Key, v.Value); + foreach (KeyValuePair, KeyValuePair> kvp in m_positionMap) + { + KeyValuePair k = kvp.Key; + KeyValuePair v = kvp.Value; + posmap += String.Format("{0},{1},{2},{3}\n", + k.Key, k.Value, v.Key, v.Value); + } } buf = enc.GetBytes(posmap);