diff options
Diffstat (limited to 'apps/dav/appinfo')
-rw-r--r-- | apps/dav/appinfo/app.php | 6 |
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()); + } }); |