Don't include shared addressbook if source not found

This commit is contained in:
Michael Gapczynski 2012-08-08 19:12:59 -04:00
parent d02b0e39b2
commit f4285a25ef

View file

@ -69,8 +69,10 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
$addressbooks = array();
foreach ($items as $item) {
$addressbook = OC_Contacts_Addressbook::find($item['item_source']);
$addressbook['displayname'] = $item['item_target'];
$addressbooks[] = $addressbook;
if ($addressbook) {
$addressbook['displayname'] = $item['item_target'];
$addressbooks[] = $addressbook;
}
}
return $addressbooks;
}