diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 13:20:27 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 13:20:27 +0100 |
commit | b2d381a1267771a7045292acc2109f6ddab1fad5 (patch) | |
tree | 2a8aeac9434d0531b31f0cd3447ad79c7d83c527 /bin | |
parent | a810aa9e4a3c42afc60c09e8ac7e82f92c7c3c41 (diff) |
Avoid null properties
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-zugbildung-to-json | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/db-zugbildung-to-json b/bin/db-zugbildung-to-json index c00b784..759f2f7 100755 --- a/bin/db-zugbildung-to-json +++ b/bin/db-zugbildung-to-json @@ -440,6 +440,14 @@ for my $train ( values %map ) { end => $end, postEnd => $post_end, }; + + for my $k ( keys %{ $train->{route} } ) { + if ( not defined $train->{route}{$k} ) { + + # avoid null values (leave out the property instead) + delete $train->{route}{$k}; + } + } } for my $train ( values %map ) { |