mirror of
https://github.com/friendica/friendica
synced 2025-01-09 14:44:45 +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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = json_decode($curlResult->getBodyString());
|
$data = json_decode($curlResult->getBodyString(), false);
|
||||||
|
|
||||||
if (!$curlResult->isSuccess()) {
|
if (!$curlResult->isSuccess()) {
|
||||||
$this->logger->notice('API Error', ['url' => $url, 'code' => $curlResult->getReturnCode(), 'error' => $data ?: $curlResult->getBodyString()]);
|
$this->logger->notice('API Error', ['url' => $url, 'code' => $curlResult->getReturnCode(), 'error' => $data ?: $curlResult->getBodyString()]);
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
$this->pConfig->set($uid, 'bluesky', 'status', self::STATUS_API_FAIL);
|
$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;
|
return null;
|
||||||
}
|
}
|
||||||
$data->code = $curlResult->getReturnCode();
|
$data->code = $curlResult->getReturnCode();
|
||||||
|
|
Loading…
Reference in a new issue