From d71a39c47051e216cf16c3e475ab60dfd8704218 Mon Sep 17 00:00:00 2001 From: ramonn Date: Wed, 13 Nov 2013 12:09:28 +0000 Subject: [PATCH] 2013-11-13 Ramon Novoa * lib/PandoraFMS/DataServer.pm: Fixed a bug when a parent was defined but empty in the XML and an agent with an empty address existed in the database. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9071 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/DataServer.pm | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 4fc75a7a86..f5df71c5a3 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2013-11-13 Ramon Novoa + + * lib/PandoraFMS/DataServer.pm: Fixed a bug when a parent was defined but + empty in the XML and an agent with an empty address existed in the + database. + 2013-11-11 Ramon Novoa * lib/PandoraFMS/Config.pm, diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index fc09edbef7..7196dde749 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -228,7 +228,7 @@ sub process_xml_data ($$$$$) { # Parent Agent Name my $parent_id = 0; # Default value for unknown parent my $parent_agent_name = $data->{'parent_agent_name'}; - if (defined ($parent_agent_name)) { + if (defined ($parent_agent_name) && $parent_agent_name ne '') { $parent_id = get_agent_id ($dbh, $parent_agent_name); if ($parent_id < 1) { # Unknown parent $parent_id = 0;