diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-01-02 15:17:54 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-01-02 15:17:54 +0100 |
commit | 377d54ef0a064ce24feab05cdbb0733f9967b84d (patch) | |
tree | 492423e3fab4ffdcaf6219529e562b5971a59f5b | |
parent | b682508bc6e0500853c45bddac23d32e92ab6e94 (diff) |
train_subtype: return undef if unknown
-rwxr-xr-x | bin/db-wagenreihung | 2 | ||||
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung.pm | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung index 5c01cf5..3757654 100755 --- a/bin/db-wagenreihung +++ b/bin/db-wagenreihung @@ -72,7 +72,7 @@ my $wr = Travel::Status::DE::DBWagenreihung->new( printf( "%s %s (%s) in %s Gleis %s\n\n", - $wr->train_type, $wr->train_no, $wr->train_subtype, + $wr->train_type, $wr->train_no, $wr->train_subtype // '-', $wr->station_name, $wr->platform ); diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 8b0d6cc..962211a 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -207,7 +207,7 @@ sub train_subtype { if ( $ml{ $likelihood[0] } <= 2 ) { # inconclusive - return '???'; + return undef; } return $likelihood[0]; |