mantis 9028: check for for a null (should not be needed)

This commit is contained in:
UbitUmarov
2022-09-25 15:41:56 +01:00
parent 5ef7878613
commit 66113831dd

View File

@@ -101,6 +101,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
protected bool m_exportPrintRegionName = false; // prints the region name exported map
protected bool m_localV1MapAssets = false; // keep V1 map assets only on local cache
private readonly object m_sceneLock = new object();
public WorldMapModule()
{
}
@@ -146,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
string[] configSections = new string[] { "Map", "Startup" };
if (Util.GetConfigVarFromSections<string>(
config, "WorldMapModule", configSections, "WorldMap") == "WorldMap")
config, "WorldMapModule", configSections, "WorldMap") == "WorldMap")
m_Enabled = true;
expireBlackListTime = (int)Util.GetConfigVarFromSections<int>(config, "BlacklistTimeout", configSections, 10 * 60);
@@ -164,7 +165,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (!m_Enabled)
return;
lock (scene)
lock (m_sceneLock)
{
m_scene = scene;
m_regionHandle = scene.RegionInfo.RegionHandle;
@@ -195,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (!m_Enabled)
return;
lock (m_scene)
lock (m_sceneLock)
{
m_Enabled = false;
RemoveHandlers();
@@ -1321,7 +1322,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
SolidBrush sea = new SolidBrush(Color.DarkBlue);
g.FillRectangle(sea, 0, 0, spanX, spanY);
@@ -1421,8 +1422,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
public void HandleGenerateMapConsoleCommand(string module, string[] cmdparams)
{
Scene consoleScene = m_scene.ConsoleScene();
if(m_scene == null)
return;
Scene consoleScene = m_scene.ConsoleScene();
if (consoleScene != null && consoleScene != m_scene)
return;