diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-06-06 17:03:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-06-06 17:03:54 +0200 |
commit | 7e3ea47a68e8e87e321ac01f6f046733bca6aef5 (patch) | |
tree | 735a1033cb966c4da07521aa0d2d0610ae2bb6c9 | |
parent | a88cbfbb9c163c95253f39aaaf3a1664a180ea2a (diff) |
icli -ld: Do not crash when no host / service downtimes are present
-rwxr-xr-x | bin/icli | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1167,7 +1167,7 @@ elsif ( $list_type eq 'q' ) { display_queue(); } elsif ( $list_type eq 'd' ) { - if ( @{ $data->{hostdowntimes} } ) { + if ( exists $data->{hostdowntimes} ) { say "Host downtimes:"; if ( $verbosity == 1 ) { printf( "%-25.25s %-20.20s %-20.20s\n", 'Host', 'start', 'stop' ); @@ -1183,7 +1183,7 @@ elsif ( $list_type eq 'd' ) { else { say "No host downtimes"; } - if ( @{ $data->{servicedowntimes} } ) { + if ( exists $data->{servicedowntimes} ) { say "\nService downtimes:"; if ( $verbosity == 1 ) { printf( "%-25.25s %-25.25s %-20.20s %-20.20s\n", |