diff --git a/inc/config.class.php b/inc/config.class.php index e4b753591409..08d947185267 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -2664,8 +2664,10 @@ public static function agreeDevMessage($bg = false) { * @return Zend\Cache\Storage\StorageInterface object or false */ public static function getCache($optname, $context = 'core') { + global $DB; + - if (defined('TU_USER') && ! defined('CACHED_TESTS')) { + if (defined('TU_USER') && !defined('CACHED_TESTS') || !$DB || !$DB->tableExists(self::getTable())) { return false; }