From 5edfd030687250a2784ed6aefb255a65c0f37bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 18 Apr 2013 14:06:49 +0200 Subject: [PATCH] // don't try to clear smarty cache if smarty is not defined --- classes/Tools.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 49db8cd9e..e0e91e3a1 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2119,9 +2119,12 @@ exit; */ public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null) { - if (is_null($smarty)) + if ($smarty === null) $smarty = Context::getContext()->smarty; - + + if ($smarty === null) + return; + if (!$tpl && $cache_id === null && $compile_id === null) return $smarty->clearAllCache(); @@ -2454,4 +2457,3 @@ function cmpPriceDesc($a, $b) return -1; return 0; } -