text-vcard
text-vcard copied to clipboard
Error processing Gmail's contacts.vcf
hi, i recently started to get this error while processing gmail contacts exported in vcf format:
Can't call method "family" on an undefined value at /usr/local/share/perl/5.26.1/vCard/AddressBook.pm line 208.
this code used to work for years, without problems. I believe something changed on google's side.
That's not only happening with GMail but with any vCard which lacks specific attributes, in this case the "N:" value. Cf. https://bugs.debian.org/958194
I guess the _copy_name
sub should check for the existence / should check the result of ->get('n')
like the other _copy_FOO
subs do.
I try to merge PR's with tests (but don't always have time) and do releases after that :)
If anyone is open to doing a PR that is
Here is an example (not a real person):
BEGIN:VCARD VERSION:3.0 FN:Curtis Lopez N:Lopez;Curtis;;; EMAIL;TYPE=INTERNET:[email protected] TEL;TYPE=CELL:(406) 869-1855 ADR;TYPE=HOME:;;4685 Coolidge Street;Billings;MT;59101;United States of America;4 685 Coolidge Street\nBillings\nMT\n59101\nUnited States of America NOTE:Works as a nursing assistant\,\nINITIALS: C.L. CATEGORIES:Newsletter,myContacts END:VCARD
After the Country value there is an optional 8th value ('LABEL') containing a formatted version of the complete address.