From: Michael Date: Sun, 30 Oct 2022 10:02:12 +0000 (+0000) Subject: Symplified code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b402a760a8368de5cacfc4b9e1655d4eb173ffb4;p=friendica.git Symplified code --- diff --git a/src/Model/Item.php b/src/Model/Item.php index f95b22e27b..d148bf2738 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3690,13 +3690,12 @@ class Item } $shared_item = Post::selectFirst(['uri-id'], ['id' => $id]); - if (!DBA::isResult($shared_item)) { - Logger::warning('Post does not exist.', ['id' => $id, 'url' => $url, 'uid' => $uid]); - return 0; - } else { + if (!empty($shared_item['uri-id'])) { Logger::debug('Fetched shared post', ['id' => $id, 'url' => $url, 'uid' => $uid]); + return $shared_item['uri-id']; } - return $shared_item['uri-id']; + Logger::warning('Post does not exist although it was supposed to had been fetched.', ['id' => $id, 'url' => $url, 'uid' => $uid]); + return 0; } }