$vcaddressbookids[] = $vcaddressbook['id'];
}
$vccontacts = OC_Contacts_VCard::all($vcaddressbookids);
- if(count($vccontacts) == 0) {
- bailOut(OC_Contacts_App::$l10n->t('No contacts found.'));
- }
-
- $cards = array();
- foreach($vccontacts as $vccontact) {
- $cards[] = $vccontact['carddata'];
- }
+ if(count($vccontacts) > 0) {
+ $cards = array();
+ foreach($vccontacts as $vccontact) {
+ $cards[] = $vccontact['carddata'];
+ }
- OC_Contacts_App::$categories->rescan($cards);
- $categories = OC_Contacts_App::$categories->categories();
+ OC_Contacts_App::$categories->rescan($cards);
+ $categories = OC_Contacts_App::$categories->categories();
+ }
}
}