fix: return in case pubkey is undefined
This commit is contained in:
parent
24068d12d0
commit
8d7621fbaf
|
@ -11,7 +11,8 @@ async function renderReport(reportEvent: DittoEvent, profile: DittoEvent) {
|
||||||
|
|
||||||
const statusIds = reportEvent.tags.filter(([name]) => name === 'e').map((tag) => tag[1]) ?? [];
|
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 {
|
return {
|
||||||
id: reportEvent.id,
|
id: reportEvent.id,
|
||||||
|
|
Loading…
Reference in New Issue