1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Merge pull request #824 from martin-rueegg/martin-rueegg-avoid-offset-error

Avoid "Undefined offset: 0"
This commit is contained in:
LEDfan 2015-03-12 14:31:06 +01:00
commit 1642fa5419

View File

@ -85,10 +85,12 @@ class Shared extends Database {
Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS
);
// Not sure if I'm doing it wrongly, or if its supposed to return
// the info in an array?
$addressBook = (isset($addressBook['permissions']) ? $addressBook : $addressBook[0]);
if(count($addressBook) == 0) {
return null;
}
$addressBook = $addressBook[0];
if(!isset($addressBook['permissions'])) {
return null;
}