Merge pull request #10419 from annando/fatal

Fix fatal error:  Uncaught TypeError: Argument 1 passed to Friendica\Model\Post\Media::existsByURIId() must be of the type int, null given
This commit is contained in:
Hypolite Petovan 2021-06-21 08:46:03 -04:00 committed by GitHub
commit 1f69797a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -518,7 +518,7 @@ class Item
public static function isValid(array $item)
{
// When there is no content then we don't post it
if (($item['body'] . $item['title'] == '') && !Post\Media::existsByURIId($item['uri-id'])) {
if (($item['body'] . $item['title'] == '') && (empty($item['uri-id']) || !Post\Media::existsByURIId($item['uri-id']))) {
Logger::notice('No body, no title.');
return false;
}