summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-21 10:17:39 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-21 10:17:39 +0100
commitf952d183480ca87e5e30aef8c75e35b0b6076684 (patch)
tree0a163ff1587dad65232031284e0873bb893b8512
parentbf0096940bc48d670aa779a08ed18c1d7914841e (diff)
cycles must have "from" and "to" entries
-rwxr-xr-xbin/db-zugbildung-to-json6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/db-zugbildung-to-json b/bin/db-zugbildung-to-json
index 8ed2289..a09fe31 100755
--- a/bin/db-zugbildung-to-json
+++ b/bin/db-zugbildung-to-json
@@ -478,9 +478,9 @@ for my $train ( values %map ) {
}
}
}
- if ( exists $train->{cycle}{from} ) {
- @{ $train->{cycle}{from} } = uniq @{ $train->{cycle}{from} };
- @{ $train->{cycle}{to} } = uniq @{ $train->{cycle}{to} };
+ if ( exists $train->{cycle} ) {
+ @{ $train->{cycle}{from} } = uniq @{ $train->{cycle}{from} // [] };
+ @{ $train->{cycle}{to} } = uniq @{ $train->{cycle}{to} // [] };
}
}