diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-09-24 20:39:29 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-09-24 20:39:29 +0200 |
commit | 0e2b90b0454b6986878d50a52289b2e96b9ac309 (patch) | |
tree | ea3c1fd20e0cc738a9f906dc94572da9c7f0b056 /lib/Travel/Status/DE | |
parent | 8ab29ec6ac3be4d96aec1ebc55ad4d77a105d05e (diff) |
fix defined-check for $info
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 4 |
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{} ); } |