diff options
author | Matthias Rauter <matthias.rauter@qt.io> | 2023-02-23 13:19:55 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-23 18:25:11 +0000 |
commit | 3b309b082097f41a9401aee471819c339b074a32 (patch) | |
tree | 09b2aa3c77a09fe04f71a3f839c676274572751b | |
parent | bd1d2deaa592ac9155698d15a588490a6d6b16e1 (diff) | |
download | qtlocation-3b309b082097f41a9401aee471819c339b074a32.tar.gz |
Return early from export function if data is empty to avoid crashes
Change-Id: I4713d4a97b7854df8310e6d0766a694e11473768
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 925d9cb0308af5b9d7ae84e7e16ca2c73a88b369)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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; |