diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-10 19:35:53 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-10 19:35:53 +0200 |
commit | e6ba4b0e3b99d7bc263fe53283fe69ef557b42eb (patch) | |
tree | 72f0676608bacdc84f641d418a4b84a5824363db /lib/Travelynx | |
parent | 78d4494364a577ac2c17ffef36a8020b66d76654 (diff) |
backend selection: handle backends that are no longer supported
Diffstat (limited to 'lib/Travelynx')
-rw-r--r-- | lib/Travelynx/Controller/Account.pm | 12 |
1 files 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, |