summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-08-16 18:14:31 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-08-16 18:14:31 +0200
commitbc1310264dfee61081562b5ee0315addc44e89f3 (patch)
tree7a4450d334bace0fdec71182f6ba34d390974c20 /lib/Travel/Status/DE
parentbe1be950d17094147970c02ae3ba8f514162c90a (diff)
Journey: Deal with backends that do not provide a stopL (empty route)
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm
index c943a40..1014d8a 100644
--- a/lib/Travel/Status/DE/HAFAS/Journey.pm
+++ b/lib/Travel/Status/DE/HAFAS/Journey.pm
@@ -158,7 +158,7 @@ sub new {
}
$ref->{is_additional} = $journey->{stbStop}{isAdd};
}
- elsif ( $stops[0]{loc} ) {
+ elsif ( $stops[0] and $stops[0]{loc} ) {
$ref->{route_start} = $stops[0]{loc}->name;
}
@@ -307,7 +307,7 @@ sub polyline {
sub route {
my ($self) = @_;
- if ( $self->{route} ) {
+ if ( $self->{route} and @{ $self->{route} } ) {
if ( $self->{route}[0] and $self->{route}[0]{stop} ) {
$self->{route}
= [ map { Travel::Status::DE::HAFAS::Stop->new( %{$_} ) }