1
0
Fork 0

Merge pull request #11734 from Quix0r/fixes/added-final-check-link_item

$link_item might be boolean (no record found) under rare conditions
This commit is contained in:
Hypolite Petovan 2022-07-13 17:08:48 -04:00 committed by GitHub
commit 5d1ed5e71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,6 +183,13 @@ class Notification extends BaseFactory implements ICanCreateFromTableRow
}
}
// Final check on $link_item
// @see https://github.com/friendica/friendica/issues/11632#issuecomment-1183365937
if (empty($link_item)) {
$this->logger->info('Link item is still empty. Dumping whole Notification object:', [$Notification]);
return $message;
}
$link = $this->baseUrl . '/display/' . urlencode($link_item['guid']);
$body = BBCode::toPlaintext($item['body'], false);