diff --git a/pandora_console/include/class/ManageNetScanScripts.class.php b/pandora_console/include/class/ManageNetScanScripts.class.php index e41e692146..16dfa70f42 100644 --- a/pandora_console/include/class/ManageNetScanScripts.class.php +++ b/pandora_console/include/class/ManageNetScanScripts.class.php @@ -350,28 +350,21 @@ class ManageNetScanScripts extends Wizard ['id_recon_script' => $id_script] ); + $result_dlt2 = db_process_sql_delete( + 'trecon_task', + ['id_recon_script' => $id_script] + ); + if (!$result_dlt) { $result = [ 'error' => 1, 'msg' => __('Problem deleting Net scan Scripts'), ]; } else { - $result_dlt2 = db_process_sql_delete( - 'trecon_task', - ['id_recon_script' => $id_script] - ); - - if (!$result_dlt2) { - $result = [ - 'error' => 1, - 'msg' => __('Problem deleting Net scan Scripts'), - ]; - } else { - $result = [ - 'error' => 0, - 'msg' => __('Deleted successfully'), - ]; - } + $result = [ + 'error' => 0, + 'msg' => __('Deleted successfully'), + ]; } return $result;