mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user