From f952d183480ca87e5e30aef8c75e35b0b6076684 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 21 Dec 2020 10:17:39 +0100 Subject: cycles must have "from" and "to" entries --- bin/db-zugbildung-to-json | 6 +++--- 1 file 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} // [] }; } } -- cgit v1.2.3