From 129d488279f571ed853360e097f395fd3b481eec Mon Sep 17 00:00:00 2001 From: Dzmitry Saniuk <32801067+scorpsan@users.noreply.github.com> Date: Fri, 7 Apr 2023 00:18:32 +0300 Subject: [PATCH] bug fix --- GeoIp.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GeoIp.php b/GeoIp.php index 1adc759..6e1165e 100644 --- a/GeoIp.php +++ b/GeoIp.php @@ -152,6 +152,8 @@ public function getInfoDb($ip = null) $userip = $ip; else $userip = $this->getIp(); + if (!$userip) + return false; $response = new Database(Yii::getAlias('@vendor') . '/ip2location/ip2location-php/data/IP2LOCATION-LITE-DB1.BIN', \IP2Location\Database::FILE_IO); $result = $response->lookup($userip, \IP2Location\Database::ALL);