Skip to content

Commit

Permalink
FIX: improve error handling in lap timing parser (fixes #431)
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Aug 28, 2023
1 parent a090258 commit 44cbf15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastf1/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def _laps_data_driver(driver_raw, empty_vals, drv):
# (Note: those lap times cannot be used for correct personal best
# detection, because the previous value is not resent here when a lap
# is deleted.)
if val := recursive_dict_get(resp, 'BestLapTimes'):
if (val := resp.get('BestLapTimes')) and isinstance(val, dict):
session_n = int(list(val.keys())[0])
if (session_n + 1) > len(session_split_times):
session_split_times.append(to_timedelta(time))
Expand Down

0 comments on commit 44cbf15

Please sign in to comment.