From e6ba4b0e3b99d7bc263fe53283fe69ef557b42eb Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 10 Aug 2024 19:35:53 +0200 Subject: [PATCH] backend selection: handle backends that are no longer supported --- lib/Travelynx/Controller/Account.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index b7b2b78..08d173a 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -1012,13 +1012,19 @@ sub backend_form { $backend->{name} = 'DB'; } elsif ( $backend->{hafas} ) { - $type = 'HAFAS'; - $backend->{longname} - = $self->hafas->get_service( $backend->{name} )->{name}; + if ( my $s = $self->hafas->get_service( $backend->{name} ) ) { + $type = 'HAFAS'; + $backend->{longname} = $s->{name}; + } + else { + $type = undef; + } } $backend->{type} = $type; } + @backends = grep { $_->{type} } @backends; + $self->render( 'select_backend', backends => \@backends,