From b7a1efe33cd8921039426101709a2a9d6022d46e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 30 Jan 2025 21:56:45 -0600 Subject: [PATCH] localSuggestionsController: skip accounts without a profile --- src/controllers/api/suggestions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controllers/api/suggestions.ts b/src/controllers/api/suggestions.ts index c939b1ab..0c887b12 100644 --- a/src/controllers/api/suggestions.ts +++ b/src/controllers/api/suggestions.ts @@ -113,14 +113,15 @@ export const localSuggestionsController: AppController = async (c) => { ) .then((events) => hydrateEvents({ store, events, signal })); - const suggestions = await Promise.all([...pubkeys].map(async (pubkey) => { + const suggestions = (await Promise.all([...pubkeys].map(async (pubkey) => { const profile = profiles.find((event) => event.pubkey === pubkey); + if (!profile) return; return { source: 'global', - account: profile ? await renderAccount(profile) : await accountFromPubkey(pubkey), + account: await renderAccount(profile), }; - })); + }))).filter(Boolean); return paginated(c, grants, suggestions); };