Merge pull request #23507 from owncloud/fix-23496-master

Avoid fatal php error dring cron execution
This commit is contained in:
Thomas Müller 2016-03-23 17:21:49 +01:00
commit 765cff49fa

View file

@ -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());
}
});