fixed api call check when cluster id does not exist

This commit is contained in:
alejandro-campos 2020-09-23 11:31:28 +02:00
parent 57b06be302
commit 86cf99ac81
1 changed files with 1 additions and 1 deletions

View File

@ -14070,7 +14070,7 @@ function api_set_delete_cluster($id, $thrash1, $thrast2, $thrash3)
$tcluster_items_delete = db_process_sql('delete from tcluster_item where id_cluster = '.$id);
$tcluster_agents_delete = db_process_sql('delete from tcluster_agent where id_cluster = '.$id);
$tcluster_delete = db_process_sql('delete from tcluster where id = '.$id);
$tcluster_agent_delete = agents_delete_agent($temp_id_cluster[0]['id_agent']);
$tcluster_agent_delete = $temp_id_cluster[0]['id_agent'] !== null ? agents_delete_agent($temp_id_cluster[0]['id_agent']) : 0;
if (($tcluster_modules_delete + $tcluster_items_delete + $tcluster_agents_delete + $tcluster_delete + $tcluster_agent_delete) == 0) {
returnError('error_delete', 'Error in delete operation.');