diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-12 19:13:23 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-12 19:13:23 +0200 |
commit | 859b03f47c84cefffe041081f7390ec7653625a5 (patch) | |
tree | 43da3440798d6e17cf26e0b1a2c7dbd408bc3cb2 /lib | |
parent | 866dc9e4b67033a6251cfb314ce141efb6975774 (diff) |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm | 4 |
1 files changed, 3 insertions, 1 deletions
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 '' |