Skip to content

Commit

Permalink
Merge pull request #84 from PrestaShop/undefined-array
Browse files Browse the repository at this point in the history
Always check if anonymousCustomer is set
  • Loading branch information
Progi1984 authored May 7, 2020
2 parents 7b89347 + 64ac405 commit 911754c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions psgdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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']);
Expand Down

0 comments on commit 911754c

Please sign in to comment.