diff options
-rwxr-xr-x | bin/db-wagenreihung | 3 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung.pm | 3 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung/Wagon.pm | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung index 3757654..11572a9 100755 --- a/bin/db-wagenreihung +++ b/bin/db-wagenreihung @@ -134,6 +134,7 @@ for my $wagon ( $wr->wagons ) { printf( "%3s: %3s %10s %s\n", $wagon->number || '?', - $wagon->model, $wagon->type, join( q{ }, $wagon->attributes ) + $wagon->model || '???', + $wagon->type, join( q{ }, $wagon->attributes ) ); } diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 0bc7ae6..51253f9 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -176,6 +176,9 @@ sub train_subtype { ); for my $wagon (@wagons) { + if ( not $wagon->model ) { + next; + } if ( $wagon->model == 401 or ( $wagon->model >= 801 and $wagon->model <= 804 ) ) { diff --git a/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm index 9d6199f..2f45e2a 100644 --- a/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm +++ b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm @@ -73,7 +73,7 @@ sub new { $ref->{section} = $opt{fahrzeugsektor}; $ref->{type} = $opt{fahrzeugtyp}; - $ref->{model} =~ s{^.....(...)....$}{$1}; + $ref->{model} =~ s{^.....(...)....$}{$1} or $ref->{model} = undef; my $self = bless( $ref, $obj ); |