Skip to content

Commit 4a1bf6d

Browse files
committed
Fix a crash when importing layers without geometry to mssql
1 parent 49e4567 commit 4a1bf6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/providers/mssql/qgsmssqlprovider.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,9 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
925925
}
926926
else
927927
{
928-
QString wkt = geom->exportToWkt();
928+
QString wkt;
929+
if ( geom && !geom->isEmpty() )
930+
wkt = geom->exportToWkt();
929931
query.addBindValue( wkt );
930932
}
931933
}

0 commit comments

Comments
 (0)