summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-06-06 17:03:54 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-06-06 17:03:54 +0200
commit7e3ea47a68e8e87e321ac01f6f046733bca6aef5 (patch)
tree735a1033cb966c4da07521aa0d2d0610ae2bb6c9
parenta88cbfbb9c163c95253f39aaaf3a1664a180ea2a (diff)
icli -ld: Do not crash when no host / service downtimes are present
-rwxr-xr-xbin/icli4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/icli b/bin/icli
index 1a7b93d..dc30273 100755
--- a/bin/icli
+++ b/bin/icli
@@ -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",