diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 10:17:39 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 10:17:39 +0100 |
commit | f952d183480ca87e5e30aef8c75e35b0b6076684 (patch) | |
tree | 0a163ff1587dad65232031284e0873bb893b8512 /bin | |
parent | bf0096940bc48d670aa779a08ed18c1d7914841e (diff) |
cycles must have "from" and "to" entries
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-zugbildung-to-json | 6 |
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} // [] }; } } |