Control if module is hashref or not

This commit is contained in:
fbsanchez 2020-02-25 09:28:44 +01:00
parent 400809ce61
commit 7fbd8e73eb
1 changed files with 1 additions and 0 deletions

View File

@ -598,6 +598,7 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
# Add modules.
if (ref($modules) eq "ARRAY") {
foreach my $module (@{$modules}) {
next unless ref($module) eq 'HASH';
# Translate data structure to simulate XML parser return.
my %data_translated = map { $_ => [ $module->{$_} ] } keys %{$module};