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 . ')'); }