Skip to content

Commit

Permalink
[spatialite] Don't crash with NULL geometries (Fix #8739)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 14, 2013
1 parent aa90589 commit 9259e27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/analysis/openstreetmap/qgsosmdatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
sqlite3_bind_null( stmtInsert, ++col );
}

sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
if ( geom )
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
else
sqlite3_bind_null( stmtInsert, ++col );

int insertRes = sqlite3_step( stmtInsert );
if ( insertRes != SQLITE_DONE )
Expand Down

1 comment on commit 9259e27

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 9259e27 Nov 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type: Fixes 8793 instead

Please sign in to comment.