From 9b3b7024a1f97d6e76be45cfa1d99c5ed3588665 Mon Sep 17 00:00:00 2001 From: Sivashankaran Kuppusaamy <72572188+SivashankaranK@users.noreply.github.com> Date: Wed, 7 Feb 2024 19:33:14 +0530 Subject: [PATCH] Handling undefined values (#351) --- lib/geocoder/heregeocoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/geocoder/heregeocoder.js b/lib/geocoder/heregeocoder.js index 7764d4a..dfd4de3 100644 --- a/lib/geocoder/heregeocoder.js +++ b/lib/geocoder/heregeocoder.js @@ -78,7 +78,7 @@ class HereGeocoder extends AbstractGeocoder { if (result.error === 'Unauthorized') { return callback(new ValueError(result.error_description), results); } - var view = result.Response.View[0]; + var view = result.Response?.View[0]; if (!view) { return callback(false, results); }