Fix warning: Undefined array key "public"

This commit is contained in:
Michael 2022-11-09 06:31:05 +00:00
parent 6af025246e
commit a7e576fda0

View File

@ -40,11 +40,12 @@ class Relationship extends BaseFactory
$cdata = Contact::getPublicAndUserContactID($contactId, $uid); $cdata = Contact::getPublicAndUserContactID($contactId, $uid);
if (!empty($cdata)) { if (!empty($cdata)) {
$cid = $cdata['user']; $cid = $cdata['user'];
$pcid = $cdata['public'];
} else { } else {
$cid = $contactId; $pcid = $cid = $contactId;
} }
return new RelationshipEntity($cdata['public'], Contact::getById($cid), return new RelationshipEntity($pcid, Contact::getById($cid),
Contact\User::isBlocked($cid, $uid), Contact\User::isIgnored($cid, $uid)); Contact\User::isBlocked($cid, $uid), Contact\User::isIgnored($cid, $uid));
} }
} }