fix: syntax error on undefined value

This commit is contained in:
Julian Lam
2026-03-09 21:53:53 -04:00
parent c718cdbb55
commit 6b3b3e7ee3

View File

@@ -219,7 +219,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
}
// Filter image attachments out if they are in content
const { attachment } = post._activitypub;
const attachment = post?._activitypub?.attachment;
if (attachment && attachment.length) {
post._activitypub.attachment = attachment.filter((attachment) => {
const inContent = attachment.type === 'Image' && (post.sourceContent || post.content).includes(attachment.url);