summaryrefslogtreecommitdiff
path: root/program/steps/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r--program/steps/addressbook/import.inc11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index a0786e214..93452eccd 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -124,6 +124,12 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
foreach ($vcards as $vcard) {
$email = $vcard->email[0];
+ // skip entries without an e-mail address
+ if (empty($email)) {
+ $IMPORT_STATS->nomail++;
+ continue;
+ }
+
if (!$replace) {
// compare e-mail address
$existing = $CONTACTS->search('email', $email, false, false);
@@ -135,11 +141,6 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
continue;
}
}
- // skip entries without an e-mail address
- if (empty($email)) {
- $IMPORT_STATS->nomail++;
- continue;
- }
$success = $CONTACTS->insert(array(
'name' => $vcard->displayname,