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"
This commit is contained in:
parent
43531d5aa0
commit
7c049abfda
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user