From 843388f82ba323965e1bff926d785a60d45f5590 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 27 May 2015 08:35:32 +0200 Subject: return a delay of undef when no delay information is available --- lib/Travel/Status/DE/EFA.pm | 2 +- lib/Travel/Status/DE/EFA/Result.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index 4883ed0..4789ccc 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -336,7 +336,7 @@ sub results { my $info = $e_info->textContent; my $key = $e_line->getAttribute('key'); my $countdown = $e->getAttribute('countdown'); - my $delay = $e_info->getAttribute('delay') // 0; + my $delay = $e_info->getAttribute('delay'); my $type = $e_info->getAttribute('name'); my $platform_is_db = 0; diff --git a/lib/Travel/Status/DE/EFA/Result.pm b/lib/Travel/Status/DE/EFA/Result.pm index e0d6ad4..95e35cd 100644 --- a/lib/Travel/Status/DE/EFA/Result.pm +++ b/lib/Travel/Status/DE/EFA/Result.pm @@ -18,7 +18,7 @@ sub new { my $ref = \%conf; - if ( $ref->{delay} eq '-9999' ) { + if ( defined $ref->{delay} and $ref->{delay} eq '-9999' ) { $ref->{delay} = 0; $ref->{is_cancelled} = 1; } @@ -86,7 +86,7 @@ Actual departure date (DD.MM.YYYY). =item $departure->delay Expected delay from scheduled departure time in minutes. A delay of 0 -indicates either departure on time or that no delay information is available. +indicates departure on time. undef when no realtime information is available. =item $departure->destination -- cgit v1.2.3