summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx')
-rw-r--r--lib/Travelynx/Controller/Account.pm12
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,