From 8f6416123a3fd0975ab5c441c80a7afcd587298b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 20 Sep 2015 13:05:51 +0200 Subject: handle undef HAFAS::Result->info value --- index.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.pl b/index.pl index 7a1fec7..0903cc8 100644 --- a/index.pl +++ b/index.pl @@ -438,7 +438,12 @@ sub handle_request { $moreinfo = [ [ 'HAFAS', $info ] ]; } if ( $result->delay and $result->delay > 0 ) { - $info = 'ca. +' . $result->delay . ': ' . $info; + if ($info) { + $info = 'ca. +' . $result->delay . ': ' . $info; + } + else { + $info = 'ca. +' . $result->delay; + } } push( @{$moreinfo}, map { [ 'HAFAS', $_ ] } $result->messages ); } @@ -465,9 +470,6 @@ sub handle_request { } } - if ( $info eq '+0' ) { - $info = undef; - } if ( $template eq 'clean' and $info and $info =~ s{ (?: ca \. \s* )? \+ (\d+) :? \s* }{}x ) -- cgit v1.2.3