diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-21 20:01:53 +0100 |
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-12-21 20:02:07 +0100 |
| commit | e2de80f6bb6e929a8f9a9fb73223c1cd8966db9c (patch) | |
| tree | ee77e6437423b79e5d3c55a4cb09cd22408bd5ba | |
| parent | d6417395491a4025ab3346a4318d8a67a2ad5db4 (diff) | |
| -rw-r--r-- | lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm | 5 |
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 ); |
