[-] FO: Fix fatal error when a customer is deleted and still logged

This commit is contained in:
Rémi Gaillard committed 2013-02-06 11:56:23 +01:00
1 parent 7b7b964f6a
commit 588276cfb1
1 file changed
+7 -1
+7 -1
View File
@@ -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();