diff --git a/ExcludeCountries.php b/ExcludeCountries.php index d2e97c7..e957407 100644 --- a/ExcludeCountries.php +++ b/ExcludeCountries.php @@ -45,7 +45,10 @@ class ExcludeCountries extends Plugin $location = $provider->getLocation(["ip" => $request->getIp()]); $countryCode = strtolower($location[LocationProvider::COUNTRY_CODE_KEY]); - + if (!$location || empty($countryCode)) { + $logger->debug("ExcludeCountries could not detect a location"); + return; + } $excludeBool = $settings->excludeBool->getValue(); if ($excludeBool) { diff --git a/plugin.json b/plugin.json index 89bde91..48d1023 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "ExcludeCountries", "description": "Exclude or include visitors from selected countries", - "version": "0.1.3", + "version": "0.1.4", "theme": false, "require": { "piwik": ">=3.10.0,<4.0.0-b1"