diff options
author | Matthias Rauter <matthias.rauter@qt.io> | 2023-02-23 13:19:55 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-02-23 17:38:08 +0000 |
commit | 925d9cb0308af5b9d7ae84e7e16ca2c73a88b369 (patch) | |
tree | e8062c82aa2079b35ad9c6360b93d160b76cc154 | |
parent | 0d7a0d92c64a906748b0676ea502ec3d6ccf27d0 (diff) | |
download | qtlocation-925d9cb0308af5b9d7ae84e7e16ca2c73a88b369.tar.gz |
Return early from export function if data is empty to avoid crashes
Pick-to: 6.5
Change-Id: I4713d4a97b7854df8310e6d0766a694e11473768
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/location/maps/qgeojson.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<QVariantMap>(); // Extracting the QVMap QJsonObject newObject; QJsonDocument newDocument; |