From 859b03f47c84cefffe041081f7390ec7653625a5 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 12 Aug 2025 19:13:23 +0200 Subject: Formation/Carriage: start/end may be undef --- lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm index 59046f2..a73bcc4 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm @@ -99,7 +99,9 @@ sub new { = ( $pos->{start} - $platform->{start} ) * 100 / $platform_length, $ref->{end_percent} = ( $pos->{end} - $platform->{start} ) * 100 / $platform_length, - $ref->{length_meters} = $pos->{start} - $pos->{end}; + if ( defined $pos->{start} and defined $pos->{end} ) { + $ref->{length_meters} = $pos->{start} - $pos->{end}; + } $ref->{length_percent} = $ref->{end_percent} - $ref->{start_percent}; if ( $pos->{start} eq '' -- cgit v1.2.3