summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-12-21 20:01:53 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-12-21 20:02:07 +0100
commite2de80f6bb6e929a8f9a9fb73223c1cd8966db9c (patch)
treeee77e6437423b79e5d3c55a4cb09cd22408bd5ba /lib/Travel
parentd6417395491a4025ab3346a4318d8a67a2ad5db4 (diff)
Carriage: handle undefined vehicleIDHEADmain
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm
index f4f602d..acc621c 100644
--- a/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm
+++ b/lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm
@@ -49,7 +49,10 @@ sub new {
$ref->{section} = $json{platformPosition}{sector};
$ref->{type} = $json{type}{constructionType};
- $ref->{model} =~ s{^.....(...)....(?:-.)?$}{$1} or $ref->{model} = undef;
+ if ( defined $ref->{model} ) {
+ $ref->{model} =~ s{^.....(...)....(?:-.)?$}{$1}
+ or $ref->{model} = undef;
+ }
my $self = bless( $ref, $obj );