diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey_fare.py b/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey_fare.py index 480ce2022d..60a249e7a0 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey_fare.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey_fare.py @@ -50,7 +50,9 @@ def async_compute_fare(self, response, request_id): self._futures.append(self._future_manager.create_future(self._do, response, request_id).get_future()) def _do(self, response, request_id): - return response, self._backend.get_pt_journeys_fares(response.journeys, request_id) + if response and response.journeys: + return response, self._backend.get_pt_journeys_fares(response.journeys, request_id) + return response, None def wait_and_generate(self): with gevent.iwait(self._futures) as futures: diff --git a/source/jormungandr/jormungandr/scenarios/journey_filter.py b/source/jormungandr/jormungandr/scenarios/journey_filter.py index d4369cccde..5f1a5b4636 100644 --- a/source/jormungandr/jormungandr/scenarios/journey_filter.py +++ b/source/jormungandr/jormungandr/scenarios/journey_filter.py @@ -754,6 +754,8 @@ def filter_olympic_site_by_min_pt_duration( origin_olympic_site = False for resp in response_list: + if not resp: + continue for j in resp.journeys: if not j.sections: continue