]> git.mxchange.org Git - friendica.git/commitdiff
Fix fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\Post\Media...
authorMichael <heluecht@pirati.ca>
Mon, 21 Jun 2021 03:53:53 +0000 (03:53 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 21 Jun 2021 03:53:53 +0000 (03:53 +0000)
src/Model/Item.php

index 769a2898aada743716eb94ee8c574204e51aa70f..5f1aaf3968811128de7ee27f326ca7e6aee1f919 100644 (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;
                }