fix: bad test that unable to create token

This commit is contained in:
yannis 2025-07-03 12:08:46 +02:00
parent f0be6e458c
commit 8b4c3ef80c

View file

@ -286,7 +286,7 @@ if (empty($reshook)) {
} else {
dol_print_error($db);
}
if (empty($nbtotalofrecords) || $nbtotalofrecords > 0) {
if (!empty($nbtotalofrecords) && $nbtotalofrecords > 0) {
setEventMessages($langs->trans("ErrorFieldExist", $langs->transnoentitiesnoconv("ApiToken")), null, 'errors');
$action = 'create';
$error++;