From cc7bc985b0752985a87ddf22a875f897e2467dd1 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Sat, 23 Mar 2024 15:23:58 +0200 Subject: [PATCH] Prevent deltas having empty strings as WKT geometry --- src/core/deltafilewrapper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/deltafilewrapper.cpp b/src/core/deltafilewrapper.cpp index 5b7d47589c..efba26ca91 100644 --- a/src/core/deltafilewrapper.cpp +++ b/src/core/deltafilewrapper.cpp @@ -996,9 +996,18 @@ void DeltaFileWrapper::setIsPushing( bool isPushing ) QJsonValue DeltaFileWrapper::geometryToJsonValue( const QgsGeometry &geom ) const { if ( geom.isNull() ) + { return QJsonValue::Null; + } + + QString wkt = geom.asWkt(); + + if ( wkt.trimmed().isEmpty() ) + { + return QJsonValue::Null; + } - return QJsonValue( geom.asWkt() ); + return QJsonValue( wkt ); }