Skip to content

Commit

Permalink
fix: get_num_geometries failing on empty geom
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaburian committed Dec 2, 2024
1 parent 6dc9005 commit f3a0e47
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 f3a0e47

Please sign in to comment.