From 48ce3ea4d3eaf5ec8df0cea0a09fee8438ff6ab9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 21 Sep 2021 16:31:07 +0200 Subject: [PATCH] FIX check if $categories is not empty --- htdocs/core/actions_addupdatedelete.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index de4b9d86da1..71288da8335 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -236,7 +236,9 @@ if ($action == 'update' && !empty($permissiontoadd)) { if ($conf->categorie->enabled) { $categories = GETPOST('categories', 'array'); - $object->setCategories($categories); + if (!empty($categories)) { + $object->setCategories($categories); + } } }