Fix Crash on show/hide sidebar in V3

GoogleMapControl crashes when the sidebar is hidden then shown
before a map has been drawn. This is because the resize event
attempts to redraw the map before all private data has been
initialised (in this case rideData is empty).
This commit is contained in:
Mark Liversedge
2011-04-09 12:15:17 +01:00
parent fff3f83064
commit 361c7bece8

View File

@@ -520,6 +520,12 @@ string GoogleMapControl::CreateMarkers()
oss << "map.addOverlay(marker);" << endl;
*/
// if we have no data (missing or not initialised) then
// return empty. This also fixes a bug on show/hide sidebar
// that causes a resize event before the map has been
// drawn for the first time
if (rideData.size() == 0) return "";
oss << CreateIntervalMarkers(ride);
// end marker