Skip to content
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

TypeError raised when accessing line1 #31

Open
backus opened this issue Nov 14, 2015 · 3 comments
Open

TypeError raised when accessing line1 #31

backus opened this issue Nov 14, 2015 · 3 comments

Comments

@backus
Copy link

backus commented Nov 14, 2015

User address of this form

1234 B AND S DR, City Name CA

caused an exception when accessing line1:

2.2.3 :006 > StreetAddress::US.parse('1234 B AND S DR, City Name CA').line1
TypeError: no implicit conversion of nil into String
    from /Users/johnbackus/.rvm/gems/ruby-2.2.3/gems/StreetAddress-1.0.6/lib/street_address.rb:867:in `+'
    from /Users/johnbackus/.rvm/gems/ruby-2.2.3/gems/StreetAddress-1.0.6/lib/street_address.rb:867:in `line1'
    from (irb):6
    from /Users/johnbackus/.rvm/rubies/ruby-2.2.3/bin/irb:15:in `<main>'

I believe the operative part is '1234 B AND S'. I think it is being parsed as an intersection when it shouldn't be?

@ngan
Copy link

ngan commented Jan 5, 2016

We're seeing this issue as well.

@ngan
Copy link

ngan commented Jan 6, 2016

Found a solution (kind of). If you're know you're parsing an real address, use parse_address or parse_informal_address instead of parse.

@chamnap
Copy link

chamnap commented Aug 17, 2016

It works from master branch, as stated here, #27.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants