Fix bug oc-413: PHP fatal error in contacts page when no contacts in ownCloud.

This commit is contained in:
Thomas Tanghus 2012-04-07 16:01:50 +02:00
parent 660951dc64
commit b71cf1a4f9
1 changed files with 8 additions and 10 deletions

View File

@ -43,10 +43,7 @@ if(count($categories) == 0) {
$vcaddressbookids[] = $vcaddressbook['id']; $vcaddressbookids[] = $vcaddressbook['id'];
} }
$vccontacts = OC_Contacts_VCard::all($vcaddressbookids); $vccontacts = OC_Contacts_VCard::all($vcaddressbookids);
if(count($vccontacts) == 0) { if(count($vccontacts) > 0) {
bailOut(OC_Contacts_App::$l10n->t('No contacts found.'));
}
$cards = array(); $cards = array();
foreach($vccontacts as $vccontact) { foreach($vccontacts as $vccontact) {
$cards[] = $vccontact['carddata']; $cards[] = $vccontact['carddata'];
@ -55,6 +52,7 @@ if(count($categories) == 0) {
OC_Contacts_App::$categories->rescan($cards); OC_Contacts_App::$categories->rescan($cards);
$categories = OC_Contacts_App::$categories->categories(); $categories = OC_Contacts_App::$categories->categories();
} }
}
} }
$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));