tomayac / local-reverse-geocoder

Local reverse geocoder for Node.js based on GeoNames data
Apache License 2.0
190 stars 58 forks source link

Referencing undefined `options.countries` when not explicitly initialized #47

Closed peterwanggg closed 2 years ago

peterwanggg commented 2 years ago

Hi, thanks for this great library.

I got an error when following the usage code snippet without calling init. I fixed this locally by adding a check for options.countries === undefined to the if statement on line 646 of index.js.

tomayac commented 2 years ago

Addressed via changing the order and wording in the README: https://github.com/tomayac/local-reverse-geocoder/commit/9b98e179f15917e6e142bcfd49b3e224e3d32ae4.

peterwanggg commented 2 years ago

@tomayac the same error is thrown if you call init() with an empty function

tomayac commented 2 years ago

What do you mean by "empty function"?