diff options
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index e91cece..f6f4151 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -572,6 +572,15 @@ sub results_stopfinder { my $json = $self->{response}; my @results; + + # Edge case: there is just a single result. + # Oh EFA, you so silly. + if ( ref( $json->{stopFinder}{points} ) eq 'HASH' + and exists $json->{stopFinder}{points}{point} ) + { + $json->{stopFinder}{points} = [ $json->{stopFinder}{points}{point} ]; + } + for my $stop ( @{ $json->{stopFinder}{points} // [] } ) { push( @results, |