diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index a39d9da92a..a4fdddc405 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -12905,8 +12905,10 @@ function api_set_create_event($id, $trash1, $other, $returnType) $error_msg = ''; if ($other['data'][2] != '') { + // Id agent assignment. $id_agent = $other['data'][2]; - if (is_metaconsole()) { + // To the next if is metaconsole and id_agent is not none. + if (is_metaconsole() === true && $id_agent > 0) { // On metaconsole, connect with the node to check the permissions if (empty($values['server_id'])) { $agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent);