georust / gdal

Rust bindings for GDAL
https://crates.io/crates/gdal
MIT License
369 stars 94 forks source link

Catch potential null pointers returned by `Dataset::spatial_ref` #540

Closed weiznich closed 6 months ago

weiznich commented 6 months ago

This otherwise hits an assertion in gdal debug builds for the OSRClone method

See https://github.com/OSGeo/gdal/blob/master/ogr/ogrspatialreference.cpp#L1406 for the relevant assertion in gdal

lnicola commented 6 months ago

Can you also add an assert! to SpatialRef::from_c_obj, since its argument must be a valid pointer?

lnicola commented 6 months ago

Thanks, will merge once GHA comes back up.