Skip to content

Node.js based forum software built for the modern web

fix: inputIndex check

Julian Lamcac4f8e7d600
diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js
index 7506c43f2e..14ad66d6e3 100644
--- a/src/activitypub/notes.js
+++ b/src/activitypub/notes.js
@@ -111,7 +111,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
const hasRelation =
uid || hasTid ||
options.skipChecks || options.cid ||
- await assertRelation(chain[inputIndex || 0]);
+ await assertRelation(chain[inputIndex !== -1 ? inputIndex : 0]);
const privilege = `topics:${tid ? 'reply' : 'create'}`;
const allowed = await privileges.categories.can(privilege, cid, activitypub._constants.uid);
if (!hasRelation || !allowed) {