From 7e3ea47a68e8e87e321ac01f6f046733bca6aef5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 6 Jun 2014 17:03:54 +0200 Subject: icli -ld: Do not crash when no host / service downtimes are present --- bin/icli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') 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", -- cgit v1.2.3