Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Nov 4, 2023
1 parent 1a3d636 commit a50625c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/Domains/Contact/ManageContact/Dav/ImportLabels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a50625c

Please sign in to comment.