[-] FO: Fix fatal error when a customer is deleted and still logged
This commit is contained in:
+12
-6
@@ -164,15 +164,21 @@ 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);
|
||||||
$customer->logged = $cookie->logged;
|
if(!Validate::isLoadedObject($customer))
|
||||||
|
$customer->logout();
|
||||||
if ($customer->id_lang != $context->language->id)
|
else
|
||||||
{
|
{
|
||||||
$customer->id_lang = $context->language->id;
|
$customer->logged = $cookie->logged;
|
||||||
$customer->update();
|
|
||||||
|
if ($customer->id_lang != $context->language->id)
|
||||||
|
{
|
||||||
|
$customer->id_lang = $context->language->id;
|
||||||
|
$customer->update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!isset($customer) || !Validate::isLoadedObject($customer))
|
||||||
{
|
{
|
||||||
$customer = new Customer();
|
$customer = new Customer();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user