From 9c74306e957683ca7e685d70a3468f2664c2cc22 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 13 Apr 2020 14:11:43 +0200 Subject: [PATCH] minor change --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 3d36bcfbaa..ba09f41162 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -469,13 +469,17 @@ sub PandoraFMS::Recon::Base::test_module($$) { $test->{'id_tipo_modulo'} = $module->{'type'}; } else { # Module. - if (!defined($self->{'module_types'}{$module->{'type'}})) { - $self->{'module_types'}{$module->{'type'}} = get_module_id( - $self->{'dbh'},$module->{'type'} - ); - } + $module->{'type'} = $module->{'module_type'} if is_empty($module->{'type'}); - $test->{'id_tipo_modulo'} = $self->{'module_types'}{$module->{'type'}}; + if (defined($module->{'type'})) { + if(!defined($self->{'module_types'}{$module->{'type'}})) { + $self->{'module_types'}{$module->{'type'}} = get_module_id( + $self->{'dbh'},$module->{'type'} + ); + } + + $test->{'id_tipo_modulo'} = $self->{'module_types'}{$module->{'type'}}; + } } my $value;