summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-21 13:20:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-21 13:20:27 +0100
commitb2d381a1267771a7045292acc2109f6ddab1fad5 (patch)
tree2a8aeac9434d0531b31f0cd3447ad79c7d83c527 /bin
parenta810aa9e4a3c42afc60c09e8ac7e82f92c7c3c41 (diff)
Avoid null properties
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-zugbildung-to-json8
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 ) {