Skip to content
Snippets Groups Projects
Commit bcddbf6f authored by Anton Sarukhanov's avatar Anton Sarukhanov
Browse files

Prevent exception when route isn't set on a prediction, or can't be looked op

parent e1c7ee45
No related branches found
No related tags found
No related merge requests found
......@@ -331,6 +331,9 @@ class Nextbus():
for prediction_set in prediction_sets:
route_tag = prediction_set.get('routeTag')
route = routes[(agency_tag, route_tag)]
if not route:
# Sometimes this happens. Skip this one, to avoid an exception.
continue
stop_tag = prediction_set.get('stopTag')
try:
stop = route.stops[stop_tag].stop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment