Skip to content

Commit

Permalink
fix: Notice: Trying to get property 'status' of non-object
Browse files Browse the repository at this point in the history
  • Loading branch information
zgelici committed Aug 4, 2019
1 parent b205c58 commit f1bd90f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/IPApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ')');
}

Expand Down

0 comments on commit f1bd90f

Please sign in to comment.