Stop exceptions being thrown if GenerateMapTiles = false but no static map tile has been set. Do more informative warn instead.

This commit is contained in:
Justin Clark-Casey (justincc)
2013-02-02 00:59:26 +00:00
parent d8d4e7f236
commit 9588328242
4 changed files with 36 additions and 10 deletions

View File

@@ -75,7 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
public void Close() { }
public void PostInitialise() { }
///<summary>
///
///</summary>
@@ -133,7 +132,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
///</summary>
public void AddRegion(Scene scene)
{
if (! m_enabled)
if (!m_enabled)
return;
// Every shared region module has to maintain an indepedent list of
@@ -206,6 +205,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
using (Image mapTile = tileGenerator.CreateMapTile())
{
// XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there
// is no static map tile.
if (mapTile == null)
return;
using (MemoryStream stream = new MemoryStream())
{
mapTile.Save(stream, ImageFormat.Jpeg);