Skip to content

Commit

Permalink
Merge pull request #161 from vladaburian/fix-get-num-geometries
Browse files Browse the repository at this point in the history
fix: get_num_geometries failing on empty geom
  • Loading branch information
GuillaumeGomez authored Dec 2, 2024
2 parents 6dc9005 + f3a0e47 commit 6eb6a65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ impl$(<$lt>)? Geom for $ty_name$(<$lt>)? {
fn get_num_geometries(&self) -> GResult<usize> {
unsafe {
let ret = GEOSGetNumGeometries_r(self.get_raw_context(), self.as_raw());
if ret < 1 {
if ret == -1 {
Err(Error::GenericError("GEOSGetNumGeometries_r failed".to_owned()))
} else {
Ok(ret as _)
Expand Down

0 comments on commit 6eb6a65

Please sign in to comment.