Commit 947e684b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Fix wrong route_pre / route_post when all prev/next stops are cancelled

parent 3bad081c
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -283,10 +283,12 @@ sub set_ar {
		$self->{platform} = $self->{sched_platform};
	}

	if ( $attrib{route_pre} ) {
	if ( defined $attrib{route_pre} ) {
		$self->{route_pre} = [ split( qr{[|]}, $attrib{route_pre} // q{} ) ];
		if ( @{ $self->{route_pre} } ) {
			$self->{route_start} = $self->{route_pre}[0];
		}
	}
	else {
		$self->{route_pre}   = $self->{sched_route_pre};
		$self->{route_start} = $self->{sched_route_start};
@@ -344,10 +346,12 @@ sub set_dp {
		$self->{platform} = $self->{sched_platform};
	}

	if ( $attrib{route_post} ) {
	if ( defined $attrib{route_post} ) {
		$self->{route_post} = [ split( qr{[|]}, $attrib{route_post} // q{} ) ];
		if ( @{ $self->{route_post} } ) {
			$self->{route_end} = $self->{route_post}[-1];
		}
	}
	else {
		$self->{route_post} = $self->{sched_route_post};
		$self->{route_end}  = $self->{sched_route_end};