diff --git a/app/Domains/Contact/ManageContact/Dav/ImportLabels.php b/app/Domains/Contact/ManageContact/Dav/ImportLabels.php index 9252213f292..fe80be42082 100644 --- a/app/Domains/Contact/ManageContact/Dav/ImportLabels.php +++ b/app/Domains/Contact/ManageContact/Dav/ImportLabels.php @@ -54,13 +54,11 @@ public function import(VCard $vcard, ?VCardResource $result): ?VCardResource private function getCategories(VCard $vcard): Collection { - $categories = $vcard->select('CATEGORIES'); + $categories = $vcard->CATEGORIES; - if ($categories === null || count($categories) === 0) { - return collect(); - } - - return collect($categories[0]->getParts()); + return $categories === null + ? collect() + : collect($categories->getParts()); } private function addLabel(Contact $contact, string $name): void