diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-05 08:46:48 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-05 08:46:48 +0200 |
commit | 59f2099d1cb384ea68b708c2571e710ba87a7adf (patch) | |
tree | 64404f0ecf128f343baf661de320869d180be8f2 /lib/Travel | |
parent | 2ccbd9b24f03e8965ff0ce9f468fb8be5b03c59d (diff) |
Journey: only split $ref->{train} if it holds a value
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Journey.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm index 4bb8f37..b3eff4c 100644 --- a/lib/Travel/Status/DE/DBRIS/Journey.pm +++ b/lib/Travel/Status/DE/DBRIS/Journey.pm @@ -32,7 +32,9 @@ sub new { # Number is either train no (ICE, RE) or line no (S, U, Bus, ...) # with no way of distinguishing between those - ( $ref->{type}, $ref->{number} ) = split( qr{\s+}, $ref->{train} ); + if ( $ref->{train} ) { + ( $ref->{type}, $ref->{number} ) = split( qr{\s+}, $ref->{train} ); + } # The line number seems to be encoded in the trip ID if ( not defined $ref->{number} |