1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +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,9 +85,11 @@ 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;