summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-04-07 16:01:50 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-04-07 16:03:43 +0200
commitb71cf1a4f97bb660a279a16ca4da864b56986a59 (patch)
tree8ec7dadaf291efc1c9e881daa81554fc34a6e28f /apps
parent660951dc64087e7ebedaad5c0ae1104d8dd4d0cf (diff)
downloadnextcloud-server-b71cf1a4f97bb660a279a16ca4da864b56986a59.tar.gz
nextcloud-server-b71cf1a4f97bb660a279a16ca4da864b56986a59.zip
Fix bug oc-413: PHP fatal error in contacts page when no contacts in ownCloud.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/index.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index 076b10c2ee2..776c57ca605 100644
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -43,17 +43,15 @@ if(count($categories) == 0) {
$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();
+ }
}
}