From: Michael Date: Sun, 9 Apr 2023 05:06:52 +0000 (+0000) Subject: No need to fetch the return data since we don't use it X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=99639632dda26a81630eb10717bee427647461b5;p=friendica-addons.git No need to fetch the return data since we don't use it --- diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 7642c5d7..906fdc53 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -510,8 +510,8 @@ function tumblr_get($connection, string $url) $data = json_decode($res->getBody()->getContents()); } catch (RequestException $exception) { $success = false; + $data = []; Logger::notice('Request failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]); - $data = json_decode($exception->getResponse()->getBody()->getContents()); } return ['success' => $success, 'data' => $data]; } @@ -525,8 +525,8 @@ function tumblr_post($connection, string $url, array $parameter) $data = json_decode($res->getBody()->getContents()); } catch (RequestException $exception) { $success = false; - Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]); $data = json_decode($exception->getResponse()->getBody()->getContents()); + Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]); } return ['success' => $success, 'data' => $data]; } \ No newline at end of file