diff --git a/lib/vCardFormatter.js b/lib/vCardFormatter.js index e90ed9f..961bbc6 100644 --- a/lib/vCardFormatter.js +++ b/lib/vCardFormatter.js @@ -360,11 +360,12 @@ } if (vCard.url) { - vCard.url.forEach((number) => { - formattedVCardString += 'URL'+ encodingPrefix + ':' + e(number) + nl(); - }); - - formattedVCardString += 'URL' + encodingPrefix + ':' + e(vCard.url) + nl(); + if(!Array.isArray(vCard.url)){ + vCard.url = [vCard.url]; + } + vCard.url.forEach((url) => { + formattedVCardString += 'URL' + encodingPrefix + ':' + e(url) + nl(); + }); } if (vCard.workUrl) {