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

bulkGeocode: Add check for undefined location property #427

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

gcstarr
Copy link
Contributor

@gcstarr gcstarr commented Jan 8, 2019

When using bulkGeocode in arcgis-rest-geocoder If geocoding returns 0 candidates for a given address, the value returned for that address is:

{
  "address": "",
  "score": 0,
  "attributes": { . . . }
}

Due to the code assuming the location property is present, this results in:
TypeError: Cannot set property 'spatialReference' of undefined
in the following line of code:
address.location.spatialReference = sr;

A quick way to reproduce this is to try a bulkGeocode that includes a nonsense singleLine like sldafjsedoifhsoaifhsdoifh.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling cba60dc on gcstarr:AddCheckForBulkNullResult into b84bad2 on Esri:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling cba60dc on gcstarr:AddCheckForBulkNullResult into b84bad2 on Esri:master.

Copy link
Contributor

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch. thx!

@jgravois jgravois merged commit de38e82 into Esri:master Jan 9, 2019
@gcstarr gcstarr deleted the AddCheckForBulkNullResult branch January 9, 2019 21:07
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

Successfully merging this pull request may close these issues.

3 participants