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

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;
}