From e5f734bb7b972916c79621d32af90a4c6e0328ea Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Mon, 14 Jun 2021 23:35:10 +0300 Subject: [PATCH] Fix issue with undefined index in results coming from OpenSourceMap plugin --- Controller/GeoIPDataController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/GeoIPDataController.php b/Controller/GeoIPDataController.php index 36a67ef..baeb832 100644 --- a/Controller/GeoIPDataController.php +++ b/Controller/GeoIPDataController.php @@ -44,7 +44,7 @@ class GeoIPDataController extends AbstractController $osm_plugin = PluginManager::getInstance()->getPlugin('Mibew:OpenStreetMap'); $osm_plugin->usersFunctionCallHandler($geo_data); - $results = $geo_data['errorCode'] ? array() : $geo_data['results']; + $results = array_key_exists('errorCode', $geo_data) && $geo_data['errorCode'] ? array() : $geo_data['results']; return new JsonResponse($results); } }