diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index 69bb6e4b..a4d3ed64 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -124,7 +124,10 @@ QMapbox::Feature featureFromMapPolygon(QDeclarativePolygonMapItem *mapItem) coordinates << QMapbox::Coordinate { coordinate.latitude(), coordinate.longitude() }; } } - coordinates.append(coordinates.first()); + + if (!coordinates.empty()) + coordinates.append(coordinates.first()); // closing the path + QMapbox::CoordinatesCollections geometry { { coordinates } }; return QMapbox::Feature(QMapbox::Feature::PolygonType, geometry, {}, getId(mapItem)); |