Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12309 from jmcanterafonseca/bug-917684
Browse files Browse the repository at this point in the history
Bug 917684 - [Contacts] Importing from SIM a contact without phone numbe...
  • Loading branch information
jmcanterafonseca committed Sep 19, 2013
2 parents 2216eb3 + 2ac3561 commit 0620108
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/communications/contacts/js/utilities/import_sim_contacts.js
Expand Up @@ -140,8 +140,19 @@ function SimContactsImporter() {
for (var i = from; i < from + CHUNK_SIZE && i < self.items.length; i++) {
var item = self.items[i];
item.givenName = item.name;
for (var j = 0; j < item.tel.length; j++) {
item.tel[j].type = 'mobile';

if (Array.isArray(item.tel)) {
var telItems = [];

for (var j = 0; j < item.tel.length; j++) {
var aTel = item.tel[j];
// Filtering out empty values
if (aTel.value && aTel.value.trim()) {
aTel.type = 'mobile';
telItems.push(aTel);
}
}
item.tel = telItems;
}

item.category = ['sim'];
Expand Down

0 comments on commit 0620108

Please sign in to comment.