mirror of
https://github.com/friendica/friendica
synced 2025-01-08 06:04:44 +00:00
Remove checks if result body is not an object
This commit is contained in:
parent
ae2b6e3bb7
commit
b1d78e34db
1 changed files with 3 additions and 6 deletions
|
@ -223,16 +223,13 @@ final class ATProtocol
|
|||
return null;
|
||||
}
|
||||
|
||||
$data = json_decode($curlResult->getBodyString());
|
||||
$data = json_decode($curlResult->getBodyString(), false);
|
||||
|
||||
if (!$curlResult->isSuccess()) {
|
||||
$this->logger->notice('API Error', ['url' => $url, 'code' => $curlResult->getReturnCode(), 'error' => $data ?: $curlResult->getBodyString()]);
|
||||
if (!$data) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status', self::STATUS_API_FAIL);
|
||||
if (!empty($data->message)) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', $data->message);
|
||||
} elseif (!empty($data->code)) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', 'Error Code: ' . $data->code);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
$data->code = $curlResult->getReturnCode();
|
||||
|
|
Loading…
Reference in a new issue