Skip to content

Commit

Permalink
fix: allow zero gps time values
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Apr 7, 2024
1 parent ed49b3e commit f64075b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/raw/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl Point {
};
point.point_source_id = read.read_u16::<LittleEndian>()?;
point.gps_time = if format.has_gps_time {
utils::some_or_none_if_zero(read.read_f64::<LittleEndian>()?)
Some(read.read_f64::<LittleEndian>()?)
} else {
None
};
Expand Down Expand Up @@ -850,6 +850,9 @@ mod tests {
if format.has_color {
point.color = Some(Color::new(0, 0, 0));
}
if format.has_gps_time {
point.gps_time = Some(0.0);
}
if format.has_waveform {
point.waveform = Some(Waveform::default());
}
Expand Down

0 comments on commit f64075b

Please sign in to comment.