Skip to content

Commit

Permalink
Update EstimationRoutingModule.java
Browse files Browse the repository at this point in the history
When no DRT suitable DRT is found, the route will be null. We need to be able to handle this situation.
  • Loading branch information
luchengqi7 committed Mar 13, 2024
1 parent 9d5e32b commit 0ad7c9f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public List<? extends PlanElement> calcRoute(RoutingRequest request) {

List<? extends PlanElement> route = delegate.calcRoute(request);

if (route == null) {
// no suitable DRT connection found (e.g., can't find DRT stops nearby), will fall back to walk mode.
return null;
}

for (PlanElement el : route) {
if (el instanceof Leg leg) {
if (leg.getRoute() instanceof DrtRoute drtRoute) {
Expand Down

0 comments on commit 0ad7c9f

Please sign in to comment.