From 7c049abfda4423cd67570ba538f291682466c44a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 27 Jun 2022 11:37:34 +0200 Subject: [PATCH] Fixed: - Contact/User::isBlocked() needs to return boolean, but sometimes (strangely) a NULL can come from database, so let's cast it This tries to fix: TypeError: "Return value of Friendica\Model\Contact\User::isBlocked() must be of the type bool, null returned" --- src/Model/Contact/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact/User.php b/src/Model/Contact/User.php index eb3d80eaa1..e0d6b1dcb2 100644 --- a/src/Model/Contact/User.php +++ b/src/Model/Contact/User.php @@ -183,7 +183,7 @@ class User if (!empty($cdata['public'])) { $public_contact = DBA::selectFirst('user-contact', ['blocked'], ['cid' => $cdata['public'], 'uid' => $uid]); if (DBA::isResult($public_contact)) { - $public_blocked = $public_contact['blocked']; + $public_blocked = (bool) $public_contact['blocked']; } } @@ -192,7 +192,7 @@ class User if (!empty($cdata['user'])) { $user_contact = DBA::selectFirst('contact', ['blocked'], ['id' => $cdata['user'], 'pending' => false]); if (DBA::isResult($user_contact)) { - $user_blocked = $user_contact['blocked']; + $user_blocked = (bool) $user_contact['blocked']; } } -- 2.39.5