New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gmail contacts import breaks if contact has no name or email #121
Comments
Could you please use the source of this repo and not the gem version if not done already? The gem has to be build newly but I cannot do this without Diego giving me more rights. Perhaps if problem persist you can make pull request, happily to merge in |
@koryteg |
…ils in gmail [Issue Diego81#121]
I was running into the same issue and made pull request #122. I think the existing nil check there was just slightly off. |
Add nil check to prevent blowing up when a contact has no e-mails in gmail [Issue #121]
I had a contact in gmail that was just a phone number(don't ask me how). but I get this error:
undefined method `[]' for nil:NilClass
block in OmniContacts::Importer::Gmail#contacts_from_response
on line 91:
contact[:first_name], contact[:last_name], contact[:name] = email_to_name(contact[:emails][0][:email]) if contact[:name].nil? && contact[:emails][0][:email]
the error comes from contact[:emails][0][:email] because you cant call [:email] on nil ( because contact[:emails][0] is nil).
The text was updated successfully, but these errors were encountered: