Skip to content

Commit 9259e27

Browse files
committed
[spatialite] Don't crash with NULL geometries (Fix #8739)
1 parent aa90589 commit 9259e27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/analysis/openstreetmap/qgsosmdatabase.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,10 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
489489
sqlite3_bind_null( stmtInsert, ++col );
490490
}
491491

492-
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
492+
if ( geom )
493+
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
494+
else
495+
sqlite3_bind_null( stmtInsert, ++col );
493496

494497
int insertRes = sqlite3_step( stmtInsert );
495498
if ( insertRes != SQLITE_DONE )

0 commit comments

Comments
 (0)