summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-24 20:39:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-24 20:39:29 +0200
commit0e2b90b0454b6986878d50a52289b2e96b9ac309 (patch)
treeea3c1fd20e0cc738a9f906dc94572da9c7f0b056 /lib
parent8ab29ec6ac3be4d96aec1ebc55ad4d77a105d05e (diff)
fix defined-check for $info
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index 0e588fc..9800ddf 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -311,10 +311,10 @@ sub results {
# " " -> no additional data, rest (if any) is delay reason
# else -> first word is not a delay reason but additional data,
# for instance "Zusatzfahrt/Ersatzfahrt" for a replacement train
- if ( $info and $info eq q{ } ) {
+ if ( defined $info and $info eq q{ } ) {
$info = undef;
}
- elsif ( substr( $info, 0, 1 ) eq q{ } ) {
+ elsif ( defined $info and substr( $info, 0, 1 ) eq q{ } ) {
substr( $info, 0, 1, q{} );
}