From 64ac405895ad3ffbfe4a8a4b72b01baf27201678 Mon Sep 17 00:00:00 2001 From: Pierre RAMBAUD Date: Tue, 28 Apr 2020 14:52:56 +0200 Subject: [PATCH] Result can be false, it's not always an array --- psgdpr.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psgdpr.php b/psgdpr.php index 00df5f8b..c6ba0fc9 100755 --- a/psgdpr.php +++ b/psgdpr.php @@ -893,7 +893,7 @@ public function deleteDataFromPrestashop($customer) $queries[] = "DELETE FROM `"._DB_PREFIX_."customer_thread` WHERE id_customer = ".(int)$customer->id; foreach ($queries as $query) { - if (Db::getInstance()->execute($query) == false) { + if (Db::getInstance()->execute($query) === false) { return false; } } @@ -923,7 +923,7 @@ public function createAnonymousCustomer() $query = 'SELECT id_customer, email FROM `'._DB_PREFIX_.'customer` c WHERE email = "anonymous@psgdpr.com" or email = "anonymous@anonymous.com"'; $anonymousCustomer = Db::getInstance()->getRow($query); - if ($anonymousCustomer['id_customer']) { + if (isset($anonymousCustomer['id_customer'])) { $id_address = Address::getFirstCustomerAddressId($anonymousCustomer['id_customer']); Configuration::updateValue('PSGDPR_ANONYMOUS_CUSTOMER', $anonymousCustomer['id_customer']);