diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index fd0042f3d..b51cf1cbc 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -1005,6 +1005,10 @@ export function routingQuery(searchId = null, updateSearchInReducer) { // This is likely due to the fact that BICYCLE_RENT is treated as a transit submode. const combinations = modes ? [baseQuery] : generateCombinations(baseQuery) + if (combinations.length === 0) { + return RoutingQueryCallResult.INVALID_MODE_SELECTION + } + dispatch( routingRequest({ activeItinerary, @@ -1171,9 +1175,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) { dispatch(updateOtpUrlParams(state, searchId)) } - return combinations.length === 0 - ? RoutingQueryCallResult.INVALID_MODE_SELECTION - : RoutingQueryCallResult.SUCCESS + return RoutingQueryCallResult.SUCCESS } }