From f1bd90ffee94df00a88da60eaffa940646609193 Mon Sep 17 00:00:00 2001 From: zadik Date: Sun, 4 Aug 2019 23:05:26 +0200 Subject: [PATCH] fix: Notice: Trying to get property 'status' of non-object --- 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 bb65576..8161e19 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 . ')'); }