summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-23 17:21:49 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-23 17:21:49 +0100
commit765cff49fab0cf293562c169061dfaf3b1bc76d4 (patch)
treee87ded2ef1ea0667641b28f89c89c259fcbcf418
parent6aa658e21bb3d5f62bf9ed9c1d7a85f66584b352 (diff)
parent765c64c73eb455ed86bbd2dddba2f81877dc0ab8 (diff)
downloadnextcloud-server-765cff49fab0cf293562c169061dfaf3b1bc76d4.tar.gz
nextcloud-server-765cff49fab0cf293562c169061dfaf3b1bc76d4.zip
Merge pull request #23507 from owncloud/fix-23496-master
Avoid fatal php error dring cron execution
-rw-r--r--apps/dav/appinfo/app.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php
index 17596ffecbb..d85a3583bf1 100644
--- a/apps/dav/appinfo/app.php
+++ b/apps/dav/appinfo/app.php
@@ -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());
+ }
});