summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-26 20:32:02 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-26 20:32:02 +0100
commit9851d828f84eb073f3ccc54fd1429621a29660bf (patch)
tree7dff2c342caf2cee3096e9fa5a056cd4e3d9030a
parent9ef75520eeaf1a568650f7368782ac63b80c09b2 (diff)
handle undefined operators
-rwxr-xr-xbin/hafas-m8
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 ) {