Fix issue with undefined index in results coming from OpenSourceMap plugin

This commit is contained in:
Fedor A. Fetisov 2021-06-14 23:35:10 +03:00
parent 56235823a4
commit e5f734bb7b

View File

@ -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);
}
}