Skip to content

Commit

Permalink
fix error if distance in 0
Browse files Browse the repository at this point in the history
  • Loading branch information
biuti committed Aug 27, 2023
1 parent a12730e commit 4778dc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airscore/core/mapUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def result_to_geojson(result, task, flight, second_interval=5):

fixes_to_keep.extend([flight.takeoff_fix.rawtime, flight.landing_fix.rawtime])
# adding best distance fix if not in goal
if not result.goal_time and result.best_distance_fix:
if not result.goal_time and hasattr(result, 'best_distance_fix') and result.best_distance_fix:
best_distance = Point((result.best_distance_fix.lon, result.best_distance_fix.lat))
time = "%02d:%02d:%02d" % rawtime_float_to_hms(result.best_distance_fix.rawtime + task.time_offset)
takeoff_landing.append(Feature(geometry=best_distance, properties={"event": "BestDistance", "time": time}))
Expand Down

0 comments on commit 4778dc2

Please sign in to comment.