From 20b537ca899215ef0d4989f350547159426c5f32 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 25 Mar 2024 11:39:06 +0100 Subject: Handle stations with empty LocL / pRefL --- lib/Travel/Status/DE/HAFAS.pm | 5 +++++ 1 file changed, 5 insertions(+) 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) { -- cgit v1.2.3