*/
static public function getSuggestions(int $uid, int $start = 0, int $limit = 80): array
{
+ if ($uid == 0) {
+ return [];
+ }
+
$cid = Contact::getPublicIdByUserId($uid);
$totallimit = $start + $limit;
$contacts = [];
namespace Friendica\Module\Api\Mastodon\Accounts;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);