street-address-rb / street-address

Detect, and dissect, US Street Addresses in strings.
MIT License
168 stars 85 forks source link

Can't covert nil into string #5

Closed tamoyal closed 9 years ago

tamoyal commented 11 years ago

It looks like in some instances,

def line1(s = "")

can return nil. I'm assuming when it's an intersection.
On line 873 you have this:

when :line1
          s += line1(s)

A string += nil will raise an exception. I think either something like:

when :line1
          l = line1(s)
          s += l if l

would fix it or if there should be an exception there, it should probably raise a custom exception