diff --git a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java index df4c54d0302..d5b8b31efce 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java @@ -200,10 +200,7 @@ private void processState(State backState, State forwardState) { // G-MAP-specific: Overwrite the name on short street edges so they are merged with longer street // sections to clean up turn-by-turn instructions. - if ( - edge instanceof StreetEdge streetEdge && - streetEdge.profileCost != null && !streetEdge.profileCost.isEmpty() - ) { + if (edge instanceof StreetEdge streetEdge && streetEdge.hasProfileCost()) { if (shouldOverwriteCurrentDirectionText(edge, direction)) { // HACK: If the instruction is "continue", the current street name is bogus and its length is very short (< 10 meters) // but not the next edge one, use the next street name and don't start a new step.