From a50625c1fd1ba80ead15c44e9c185d20c4bb037b Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Sat, 4 Nov 2023 11:27:55 +0100 Subject: [PATCH] fix --- app/Domains/Contact/ManageContact/Dav/ImportLabels.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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