summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-20 13:05:51 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-20 13:05:51 +0200
commit8f6416123a3fd0975ab5c441c80a7afcd587298b (patch)
tree2d5aeee1089f9ad98a079381ad3fa4896f7d0111 /index.pl
parent4f0d789e19187b75ca03c6b17eee84aece2e1f47 (diff)
handle undef HAFAS::Result->info value
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl10
1 files 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 )