Skip to content
Permalink
Browse files
Fix NULL ewkt
  • Loading branch information
m-kuhn committed Nov 19, 2021
1 parent 8bbd270 commit b15c52001f05788e95f68079d93dd9c6f66a1995
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -379,7 +379,10 @@ QgsReferencedGeometry QgsPostgresProvider::fromEwkt( const QString &ewkt, QgsPos

QString QgsPostgresProvider::toEwkt( const QgsReferencedGeometry &geom, QgsPostgresConn *conn )
{
return QStringLiteral( "SRID=%1;%2" ).arg( QString::number( crsToSrid( geom.crs(), conn ) ), geom.asWkt() );
if ( !geom.isNull() )
return QStringLiteral( "SRID=%1;%2" ).arg( QString::number( crsToSrid( geom.crs(), conn ) ), geom.asWkt() );
else
return QString();
}

QString QgsPostgresProvider::geomAttrToString( const QVariant &attr, QgsPostgresConn *conn )

0 comments on commit b15c520

Please sign in to comment.