# HG changeset patch # User rubidium # Date 2014-10-23 10:50:34 # Node ID baa62a870d21978df7c81a410abaaa36b4416d86 # Parent ffab6be98f94c00fd23a51eac695b9c877a2df1c (svn r27036) -Fix [FS#6148] (r26928): crash when changing smallmap colour when the smallmap window has not been opened yet diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -279,6 +279,9 @@ static SmallMapColourScheme _heightmap_s */ void BuildLandLegend() { + /* The smallmap window has never been initialized, so no need to change the legend. */ + if (_heightmap_schemes[0].height_colours == NULL) return; + /* * The general idea of this function is to fill the legend with an appropriate evenly spaced * selection of height levels. All entries with STR_TINY_BLACK_HEIGHT are reserved for this.