From beb609fa8b97a3a071f76448203daa880d34d204 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 26 Sep 2024 21:51:29 +0200 Subject: itdOdvAssignedStops can be a hashref rather than a listref... --- lib/Travel/Status/DE/EFA.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index d2a9174..2c08575 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -376,8 +376,14 @@ sub stops { return @{ $self->{stops} }; } + my $stops = $self->{response}{dm}{itdOdvAssignedStops} // []; + + if ( ref($stops) eq 'HASH' ) { + $stops = [$stops]; + } + my @stops; - for my $stop ( @{ $self->{response}{dm}{itdOdvAssignedStops} // [] } ) { + for my $stop ( @{$stops} ) { push( @stops, Travel::Status::DE::EFA::Stop->new( -- cgit v1.2.3