j4-m / gridsome-source-gmaps-geocode

Gridsome source plugin to geocode your data using the Google Maps Geocoding API 🗺️
2 stars 1 forks source link

Plugin fails if geocode source filed is null or empty #2

Open cruonline opened 3 years ago

cruonline commented 3 years ago

If one of the entities in the collection contains null, geocode API responds with 400 error.

"Invalid request. Missing the 'address', 'components', 'latlng' or 'place_id' parameter"

Seems, plugin tries to process this response and logs multiple errors.

GmapGeocode > Failed to add node: Duplicate key for property id: #### Missing typeName for reference in field: geocode

Maybe checking the source field before sending a request would be a better approach? Also, some error handling for geocode API wouldn't hurt ;-)