Merge pull request #10056 from fabrixxm/fix/panic-at-the-private-messages

PM: skip messages from missing contacts
This commit is contained in:
Hypolite Petovan 2021-03-18 11:00:15 -04:00 committed by GitHub
commit fbbab822a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -451,6 +451,11 @@ function render_messages(array $msg, $t)
$body_e = $rr['body']; $body_e = $rr['body'];
$to_name_e = $rr['name']; $to_name_e = $rr['name'];
if (is_null($rr['url'])) {
// contact-id is pointing to a non existing contact
continue;
}
$contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']); $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']);
$from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']); $from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']);