Unverified Commit 7f499f9e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Journeys: get_travel_distance: fix route_start / route_end check

parent a50defbc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1355,7 +1355,7 @@ sub get_travel_distance {
	}
	@{$route_ref};

	if ( not defined $route_start and defined $route_end ) {
	if ( not( defined $route_start and defined $route_end ) ) {
		return ( 0, 0, $distance_beeline );
	}

@@ -1384,6 +1384,10 @@ sub get_travel_distance {

	my @route = @{$route_ref}[ $route_start .. $route_end ];

	if ( not @route ) {
		return ( 0, 0, $distance_beeline );
	}

	# Just like the route, the polyline may contain the same stop more than
	# once. So we need to select based on the seen counter.
	my $poly_start = first_index {