summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status')
-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 );