Skip to content

Commit f1bd90f

Browse files
committed
fix: Notice: Trying to get property 'status' of non-object
1 parent b205c58 commit f1bd90f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Services/IPApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function locate($ip)
7171
$json = json_decode($data[0]);
7272

7373
// Verify response status
74-
if ($json->status !== 'success') {
74+
if ($json && $json->status !== 'success') {
7575
throw new Exception('Request failed (' . $json->message . ')');
7676
}
7777

0 commit comments

Comments
 (0)