From 6a17223289034476b6aa906cfbd2063bb08ce0cf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 19 Dec 2022 10:11:12 -0500 Subject: [PATCH] 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 --- src/Object/Api/Mastodon/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5