From b175b1429482e639f1484d017633642c859008e3 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 1 Feb 2024 11:00:42 +0200 Subject: [PATCH] try fixing race-condition: Call to a member function exists() on null --- api/src/Asyncservice.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/Asyncservice.php b/api/src/Asyncservice.php index 922dd6e0f5..d3a6aab61f 100644 --- a/api/src/Asyncservice.php +++ b/api/src/Asyncservice.php @@ -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']);