fix: return in case pubkey is undefined

This commit is contained in:
P. Reis 2024-05-06 14:40:56 -03:00
parent 24068d12d0
commit 8d7621fbaf
1 changed files with 2 additions and 1 deletions

View File

@ -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,