From 4bdce6948fd8dd3940d41140a606e219aecb1feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Jun 2022 23:18:05 +0200 Subject: [PATCH] Changed: - $publicContact['about'] can be NULL, causing following error: -------------------------- Argument 1 passed to Friendica\Content\Text\BBCode::toPlaintext() must be of the type string, null given, called in /.../src/Object/Api/Twitter/User.php -------------------------- The "expensive" code there can be avoided being called by an empty string or NULL to increase performance. --- src/Object/Api/Twitter/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Object/Api/Twitter/User.php b/src/Object/Api/Twitter/User.php index 67351fc220..51721a86d1 100644 --- a/src/Object/Api/Twitter/User.php +++ b/src/Object/Api/Twitter/User.php @@ -119,7 +119,7 @@ class User extends BaseDataTransferObject if (!$include_user_entities) { unset($this->entities); } - $this->description = BBCode::toPlaintext($publicContact['about']); + $this->description = (!empty($publicContact['about']) ? BBCode::toPlaintext($publicContact['about']) : ''); $this->profile_image_url_https = Contact::getAvatarUrlForUrl($publicContact['url'], $uid, Proxy::SIZE_MICRO); $this->protected = false; $this->followers_count = $apcontact['followers_count'] ?? 0;