From 925d9cb0308af5b9d7ae84e7e16ca2c73a88b369 Mon Sep 17 00:00:00 2001 From: Matthias Rauter Date: Thu, 23 Feb 2023 13:19:55 +0100 Subject: Return early from export function if data is empty to avoid crashes Pick-to: 6.5 Change-Id: I4713d4a97b7854df8310e6d0766a694e11473768 Reviewed-by: Volker Hilsheimer --- src/location/maps/qgeojson.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/location/maps/qgeojson.cpp b/src/location/maps/qgeojson.cpp index 2f746cb5..765fc5ec 100644 --- a/src/location/maps/qgeojson.cpp +++ b/src/location/maps/qgeojson.cpp @@ -1058,6 +1058,8 @@ the data converted to GeoJSON. */ QJsonDocument exportGeoJson(const QVariantList &geoData) { + if (geoData.isEmpty()) + return QJsonDocument(); QVariantMap exportMap = geoData.at(0).value(); // Extracting the QVMap QJsonObject newObject; QJsonDocument newDocument; -- cgit v1.2.1