From: Hypolite Petovan Date: Mon, 19 Dec 2022 15:11:12 +0000 (-0500) Subject: Ward against null value in language key of item array in Mastodon\Status object X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6a17223289034476b6aa906cfbd2063bb08ce0cf;p=friendica.git Ward against null value in language key of item array in Mastodon\Status object - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1357768936 --- diff --git a/src/Object/Api/Mastodon/Status.php b/src/Object/Api/Mastodon/Status.php index 2889388558..eae53ef4a9 100644 --- a/src/Object/Api/Mastodon/Status.php +++ b/src/Object/Api/Mastodon/Status.php @@ -114,7 +114,7 @@ class Status extends BaseDataTransferObject $visibility = ['public', 'private', 'unlisted']; $this->visibility = $visibility[$item['private']]; - $languages = json_decode($item['language'], true); + $languages = json_decode($item['language'] ?? '', true); if (is_array($languages)) { reset($languages); $this->language = key($languages);