summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-08-12 19:13:23 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-08-12 19:13:23 +0200
commit859b03f47c84cefffe041081f7390ec7653625a5 (patch)
tree43da3440798d6e17cf26e0b1a2c7dbd408bc3cb2 /lib/Travel/Status
parent866dc9e4b67033a6251cfb314ce141efb6975774 (diff)
Formation/Carriage: start/end may be undefHEADmain
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm4
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 ''