From d0ea0011874e1c60b1e597d6ed1cca3d2715b64e Mon Sep 17 00:00:00 2001 From: Vladan Date: Fri, 28 Apr 2023 02:25:49 +0200 Subject: [PATCH] Update IPApi.php geoip.ERROR: ErrorException: Attempt to read property "status" on null in /home/laravel/public_html/vendor/torann/geoip/src/Services/IPApi.php:74 --- src/Services/IPApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/IPApi.php b/src/Services/IPApi.php index e76e3b1..9fba30a 100644 --- a/src/Services/IPApi.php +++ b/src/Services/IPApi.php @@ -71,7 +71,7 @@ public function locate($ip) $json = json_decode($data[0]); // Verify response status - if ($json->status !== 'success') { + if ($json && $json->status !== 'success') { throw new Exception('Request failed (' . $json->message . ')'); }