diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-02-14 15:07:54 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-02-14 15:07:54 +0100 |
commit | bdd93836aa0613e5f9c61f2496505e4c45f1febc (patch) | |
tree | 980c84b843cbb5f6862ad6d309a567aaeea7f928 /src/services/checks | |
parent | 9057462c34977103a2c68124ee8f50a2d1a967ce (diff) |
Fix FN repair step for ORG
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/services/checks')
-rw-r--r-- | src/services/checks/missingFN.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/services/checks/missingFN.js b/src/services/checks/missingFN.js index 86a92c7a..fc59946b 100644 --- a/src/services/checks/missingFN.js +++ b/src/services/checks/missingFN.js @@ -41,7 +41,7 @@ export default { // -> John Stevenson const n = contact.vCard.getFirstPropertyValue('n') const fullName = n.slice(0, 2).reverse().join(' ') - if (fullName.trim() !== '') { + if (fullName && fullName.trim() !== '') { contact.fullName = fullName return true } @@ -50,9 +50,11 @@ export default { const org = contact.vCard.getFirstPropertyValue('org') // ABC, Inc.;North American Division;Marketing // -> ABC, Inc. - const fullName = org[0] - if (fullName.trim() !== '') { - contact.fullName = fullName + if (Array.isArray(org) && org[0].trim() !== '') { + contact.fullName = org[0] + return true + } else if (org && org.trim() !== '') { + contact.fullName = org return true } return false |