diff --git a/src/services/GeoService.php b/src/services/GeoService.php index c83ad64..4696f41 100644 --- a/src/services/GeoService.php +++ b/src/services/GeoService.php @@ -740,6 +740,11 @@ private static function _latLngFromAddress_Google ($token, $address, $country): $data = (string) static::_client()->get($url)->getBody(); $data = Json::decodeIfJson($data); + if (is_array($data) && array_key_exists('error_message', $data)) { + Craft::error('Google Maps Geocoding API error: ' . $data['error_message'], 'maps'); + return null; + } + if (!is_array($data) || empty($data['results'])) return null;