Skip to content

Commit

Permalink
Check if DB is defined; fixes glpi-project#3056
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 26, 2017
1 parent b75a0f3 commit 720758d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 720758d

Please sign in to comment.