Skip to content

Commit

Permalink
Check if DB is defined; fixes #3056
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 27, 2017
1 parent 86247ba commit 94536ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2664,8 +2664,9 @@ 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;
}

Expand Down

0 comments on commit 94536ea

Please sign in to comment.