summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-25 11:39:06 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-25 11:39:06 +0100
commit20b537ca899215ef0d4989f350547159426c5f32 (patch)
tree1713b831a442e70c4fad92c3cbaee6ac5e0aa71f /lib
parentcca75a4228622e45d831381359f6e32e46ad11a3 (diff)
Handle stations with empty LocL / pRefL
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index 9d0a4cc..0489901 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -891,6 +891,11 @@ sub station {
my @prefcounts = sort { $b->[0] <=> $a->[0] }
map { [ $_, $prefc_by_loc{$_} ] } keys %prefc_by_loc;
+ if ( not @prefcounts ) {
+ $self->{station_info} = {};
+ return $self->{station_info};
+ }
+
my $loc = $locL[ $prefcounts[0][0] ];
if ($loc) {