From 59f2099d1cb384ea68b708c2571e710ba87a7adf Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 5 Apr 2025 08:46:48 +0200 Subject: Journey: only split $ref->{train} if it holds a value --- lib/Travel/Status/DE/DBRIS/Journey.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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} -- cgit v1.2.3