From: Stephen L Johnson Date: Mon, 24 Jan 2000 05:56:41 +0000 (+0000) Subject: Fixed bug in services() and servicE_objects() returning undef instead of a X-Git-Tag: spong-2_7-alpha5~113 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=006e1047300020d71f1cf7a36ae6d2e5da1f90c1;p=spong.git Fixed bug in services() and servicE_objects() returning undef instead of a null list (i.e. return (); ) if $self->services was undefined. --- diff --git a/src/lib/Spong/Host.pm b/src/lib/Spong/Host.pm index dc3cb17..13e12b9 100755 --- a/src/lib/Spong/Host.pm +++ b/src/lib/Spong/Host.pm @@ -37,6 +37,8 @@ use Spong::History; use Spong::Info; use POSIX; +use Data::Dumper; + package Spong::Host; # Constructor. This is a lazy constructor in that it doesn't get all it's @@ -128,13 +130,13 @@ sub service { sub service_objects { my( $self, $name ) = @_; my $servicelist = $self->services(); - return $servicelist->services() if $servicelist; + if ( $servicelist ) { return $servicelist->services(); } else { return (); } } sub service_names { my $self = shift; my $servicelist = $self->services(); - return $servicelist->names() if $servicelist; + if ( $servicelist ) { return $servicelist->names(); } else { return (); } } sub color {