diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 10:41:05 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 10:41:05 +0100 |
commit | a66899c52830cf9a8ccab995e9ff4047088be8b7 (patch) | |
tree | 99b3123dc1589739998c7d99879c8e1dedae90f3 /apps/dav | |
parent | 9e9cb739879107ba0da0cf43f382d00b87ddecf4 (diff) | |
download | nextcloud-server-a66899c52830cf9a8ccab995e9ff4047088be8b7.tar.gz nextcloud-server-a66899c52830cf9a8ccab995e9ff4047088be8b7.zip |
Handle null case
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/appinfo/app.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index a38bee9824a..5202e3d38b8 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -20,6 +20,7 @@ */ use OCA\Dav\AppInfo\Application; +use Symfony\Component\EventDispatcher\GenericEvent; $app = new Application(); $app->registerHooks(); @@ -31,12 +32,14 @@ $app->registerHooks(); $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', - function(\Symfony\Component\EventDispatcher\GenericEvent $event) use ($app) { + function(GenericEvent $event) use ($app) { /** @var \OCA\DAV\CardDAV\CardDavBackend $cardDavBackend */ $cardDavBackend = $app->getContainer()->query('CardDavBackend'); $addressBookUri = $event->getSubject(); $addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri); - $cardDavBackend->deleteAddressBook($addressBook['id']); + if (!is_null($addressBook)) { + $cardDavBackend->deleteAddressBook($addressBook['id']); + } } ); |