Skip to content

Commit

Permalink
Fix rare startup bug in case there is a time but no date (ros-drivers…
Browse files Browse the repository at this point in the history
…#144)

Signed-off-by: Gabriel Gaessler <[email protected]>
  • Loading branch information
ggaessler authored Jun 19, 2022
1 parent 5557213 commit 265d902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libnmea_navsat_driver/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def convert_time_rmc(date_str, time_str):
tuple(float, float): 2-tuple of (NaN, NaN) if the sentence does not contain valid time.
"""
# If one of the time fields is empty, return NaN seconds
if not time_str[0:2] or not time_str[2:4] or not time_str[4:6]:
if not date_str[0:6] or not time_str[0:2] or not time_str[2:4] or not time_str[4:6]:
return (float('NaN'), float('NaN'))

pc_year = datetime.date.today().year
Expand Down

0 comments on commit 265d902

Please sign in to comment.