diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-26 20:32:02 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-26 20:32:02 +0100 |
commit | 9851d828f84eb073f3ccc54fd1429621a29660bf (patch) | |
tree | 7dff2c342caf2cee3096e9fa5a056cd4e3d9030a | |
parent | 9ef75520eeaf1a568650f7368782ac63b80c09b2 (diff) |
handle undefined operators
-rwxr-xr-x | bin/hafas-m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/hafas-m b/bin/hafas-m index 0dfda2a..8b22f49 100755 --- a/bin/hafas-m +++ b/bin/hafas-m @@ -419,10 +419,13 @@ elsif ( $opt{journey} ) { } if ( @prods == 1 ) { - printf( "Betrieb: %s\n\n", $prev_prod->operator ); + if ( $prev_prod->operator ) { + printf( "Betrieb: %s\n", $prev_prod->operator ); + } } else { - printf( "Betrieb: %s\n\n", join( q{, }, map { $_->operator } @prods ) ); + printf( "Betrieb: %s\n", + join( q{, }, map { $_->operator } grep { $_->operator } @prods ) ); } $prev_prod = 0; @@ -441,6 +444,7 @@ elsif ( $opt{journey} ) { my $message_id = 1; + print "\n"; for my $stop ( $result->route ) { my $msg_line = q{}; for my $message ( $stop->messages ) { |