Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
esalonico committed Jul 4, 2023
1 parent 1dbd536 commit daf748f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/google_flight_analysis/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,9 @@ def get_duration_in_minutes_from_string(s):
20 min --> 20
5 hr 55 min --> 60*5 + 55 = 355
"""
if s is None:
if s is None or not bool(re.search("hr|min", str(s))):
return None

if not bool(re.search("hr|min", str(s))):
raise ValueError("Invalid duration string:", s)

h = 0
m = 0

Expand Down

0 comments on commit daf748f

Please sign in to comment.