Handle there being no services in the response

This commit is contained in:
Isaac Connor 2020-11-20 16:35:48 -05:00
parent ec5e6b392b
commit 1b5448ede4
1 changed files with 9 additions and 6 deletions

View File

@ -117,12 +117,15 @@ sub get_service_urls {
} }
); );
if ( $result ) { if ( $result ) {
foreach my $svc ( @{ $result->get_Service() } ) { my $services = $result->get_Service();
my $short_name = $namespace_map{$svc->get_Namespace()}; if ( $services ) {
my $url_svc = $svc->get_XAddr()->get_value(); foreach my $svc ( @{ $services } ) {
if ( defined $short_name && defined $url_svc ) { my $short_name = $namespace_map{$svc->get_Namespace()};
#print "Got $short_name service\n"; my $url_svc = $svc->get_XAddr()->get_value();
$self->set_service($short_name, 'url', $url_svc); if ( defined $short_name && defined $url_svc ) {
#print "Got $short_name service\n";
$self->set_service($short_name, 'url', $url_svc);
}
} }
} }
#} else { #} else {