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 b651d2d
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 b651d2d

Please sign in to comment.