diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-06-14 22:24:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-06-14 22:24:50 +0200 |
commit | a7b8e7516be325265dce7300b17359d15a1715e0 (patch) | |
tree | 2a6620488a375c62f87d59a73532a9fa4f7059de /lib/DBInfoscreen.pm | |
parent | e2753e2a9604e9687e1ba8dda26174cc013d75c8 (diff) |
correctly initialize ice_type_map hash4.9.5
This ensures proper operation when the zugbildungsplan is empty, e.g. because
the underlying source file has become invalid.
Closes #14
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r-- | lib/DBInfoscreen.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index 7730f90..53944fd 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -94,7 +94,7 @@ sub startup { if ( -r 'share/zugbildungsplan.json' ) { my $ice_type_map = JSON->new->utf8->decode( scalar read_file('share/zugbildungsplan.json') ); - my $ret; + my $ret = {}; while ( my ( $k, $v ) = each %{ $ice_type_map->{train} } ) { if ( $v->{type} ) { $ret->{$k} = [ |