oschwald / maxminddb-golang

MaxMind DB Reader for Go
ISC License
615 stars 101 forks source link

Reader: add nil checks to prevent panics #38

Closed tonyghita closed 7 years ago

tonyghita commented 7 years ago

This change adds nil checks to exported methods of Reader, in order to prevent panics.

oschwald commented 7 years ago

I am not sure about this. The receiver will only be nil if there is a programming error, such as ignoring the error returned when opening a database. As far as I can recall, only a few places in the Go standard library check for nil receiver, and those are almost alway places where nil is a legitimate value.

tonyghita commented 7 years ago

Yes, I think you're right. I'll close this... thanks for the library!