From 8d7621fbaf242d0821c1626125139bfb982ac664 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Mon, 6 May 2024 14:40:56 -0300 Subject: [PATCH] fix: return in case pubkey is undefined --- src/views/mastodon/reports.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/mastodon/reports.ts b/src/views/mastodon/reports.ts index ec0d6c7..850f86b 100644 --- a/src/views/mastodon/reports.ts +++ b/src/views/mastodon/reports.ts @@ -11,7 +11,8 @@ async function renderReport(reportEvent: DittoEvent, profile: DittoEvent) { const statusIds = reportEvent.tags.filter(([name]) => name === 'e').map((tag) => tag[1]) ?? []; - const reportedPubkey = reportEvent.tags.find(([name]) => name === 'p')?.[1]!; + const reportedPubkey = reportEvent.tags.find(([name]) => name === 'p')?.[1]; + if (!reportedPubkey) return; return { id: reportEvent.id,