[-] FO: Fix fatal error when a customer is deleted and still logged
This commit is contained in:
1 parent
7b7b964f6a
commit
588276cfb1
1 file changed
+7
-1
@@ -164,6 +164,10 @@ else
|
|||||||
if (isset($cookie->id_customer) && (int)$cookie->id_customer)
|
if (isset($cookie->id_customer) && (int)$cookie->id_customer)
|
||||||
{
|
{
|
||||||
$customer = new Customer($cookie->id_customer);
|
$customer = new Customer($cookie->id_customer);
|
||||||
|
if(!Validate::isLoadedObject($customer))
|
||||||
|
$customer->logout();
|
||||||
|
else
|
||||||
|
{
|
||||||
$customer->logged = $cookie->logged;
|
$customer->logged = $cookie->logged;
|
||||||
|
|
||||||
if ($customer->id_lang != $context->language->id)
|
if ($customer->id_lang != $context->language->id)
|
||||||
@@ -172,7 +176,9 @@ else
|
|||||||
$customer->update();
|
$customer->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
if (!isset($customer) || !Validate::isLoadedObject($customer))
|
||||||
{
|
{
|
||||||
$customer = new Customer();
|
$customer = new Customer();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user