From 3d714495e68b097112e38fb2e45fcd1276b67b86 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 Feb 2023 20:45:01 +0100 Subject: hafas: fix redirect lop on error --- lib/DBInfoscreen/Controller/Stationboard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 04b0ba3..5cb05c4 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -46,7 +46,7 @@ sub handle_no_results { sub { my (@candidates) = @_; @candidates = map { [ $_->{name}, $_->{id} ] } @candidates; - if ( @candidates == 1 ) { + if ( @candidates == 1 and $candidates[0][0] ne $station ) { my $s = $candidates[0][0]; my $params = $self->req->params->to_string; $self->redirect_to("/${s}?${params}"); -- cgit v1.2.3