From f2a6b13ce49649bddc456f7ae5fc7f56811ce250 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 10 Jul 2014 01:57:21 +0200 Subject: fix uninitialized value when host/service has empty contactgroups list --- bin/icli | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/icli b/bin/icli index 220d0be..44dd584 100755 --- a/bin/icli +++ b/bin/icli @@ -463,11 +463,13 @@ sub enhance_status { $s->{contacts} =~ s{^ *}{}o; $s->{contacts} = [ split( m{, *}, $s->{contacts} ) ]; } - for my $group ( split( m{, *}, $s->{contact_groups} ) ) { - push( - @{ $s->{contacts} }, - @{ $config->{contactgroups}{$group} } - ); + if ($s->{contact_groups}) { + for my $group ( split( m{, *}, $s->{contact_groups} ) ) { + push( + @{ $s->{contacts} }, + @{ $config->{contactgroups}{$group} } + ); + } } } } -- cgit v1.2.3