diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 2d6a0f0f9f..6f6b9246be 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -62,7 +62,7 @@ */ function preferences($account_id = '') { - $this->db = $GLOBALS['phpgw']->db; + $this->db = is_object($GLOBALS['phpgw']->db) ? $GLOBALS['phpgw']->db : $GLOBALS['phpgw_setup']->db; $this->account_id = get_account_id($account_id); }