aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-01 10:41:05 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-01 10:41:05 +0100
commita66899c52830cf9a8ccab995e9ff4047088be8b7 (patch)
tree99b3123dc1589739998c7d99879c8e1dedae90f3 /apps/dav
parent9e9cb739879107ba0da0cf43f382d00b87ddecf4 (diff)
downloadnextcloud-server-a66899c52830cf9a8ccab995e9ff4047088be8b7.tar.gz
nextcloud-server-a66899c52830cf9a8ccab995e9ff4047088be8b7.zip
Handle null case
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/appinfo/app.php7
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']);
+ }
}
);