Merge pull request #23507 from owncloud/fix-23496-master
Avoid fatal php error dring cron execution
This commit is contained in:
commit
765cff49fa
1 changed files with 4 additions and 2 deletions
|
@ -46,6 +46,8 @@ $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove',
|
|||
|
||||
$cm = \OC::$server->getContactsManager();
|
||||
$cm->register(function() use ($cm, $app) {
|
||||
$userId = \OC::$server->getUserSession()->getUser()->getUID();
|
||||
$app->setupContactsProvider($cm, $userId);
|
||||
$user = \OC::$server->getUserSession()->getUser();
|
||||
if (!is_null($user)) {
|
||||
$app->setupContactsProvider($cm, $user->getUID());
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue