summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-04-05 08:46:48 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-04-05 08:46:48 +0200
commit59f2099d1cb384ea68b708c2571e710ba87a7adf (patch)
tree64404f0ecf128f343baf661de320869d180be8f2 /lib/Travel/Status
parent2ccbd9b24f03e8965ff0ce9f468fb8be5b03c59d (diff)
Journey: only split $ref->{train} if it holds a value
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Journey.pm4
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}