try fixing race-condition: Call to a member function exists() on null

This commit is contained in:
ralf 2024-02-01 11:00:42 +02:00
parent 83e350958c
commit b175b14294

View File

@ -433,7 +433,7 @@ class Asyncservice
//
//if ($GLOBALS['egw_info']['user']['account_id'] != $job['account_id'])
{
// run notifications, before changing account_id of enviroment
// run notifications, before changing account_id of environment
Link::run_notifies();
// unset all objects in $GLOBALS, which are created and used by ExecMethod, as they can contain user-data
foreach($GLOBALS as $name => $value)
@ -444,6 +444,12 @@ class Asyncservice
$lang = $GLOBALS['egw_info']['user']['preferences']['common']['lang'];
unset($GLOBALS['egw_info']['user']);
// trying to fix errors in async service: Call to a member function xxxxx() on null
if (!isset($GLOBALS['egw']->accounts))
{
$GLOBALS['egw']->accounts = Accounts::getInstance();
}
if (($GLOBALS['egw']->session->account_id = $job['account_id']))
{
$GLOBALS['egw']->session->account_lid = Accounts::id2name($job['account_id']);