Node.js based forum software built for the modern web
fix(activitypub): return early instead of throwing on invalid pid
Julian Lam25fd6799921b
diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.jsindex d2b028212d..737d5124eb 100644--- a/src/activitypub/inbox.js+++ b/src/activitypub/inbox.js@@ -365,14 +365,14 @@ inbox.like = async (req) => {// Proactively pull in the noteconst asserted = await activitypub.notes.assert(0, object.id, { skipChecks: 1 });if (!asserted) {- throw new Error('[[error:invalid-pid]]');+ return;}exists = true;}id = object.id;}if (!id || !exists) {- throw new Error('[[error:invalid-pid]]');+ return;}const allowed = await privileges.posts.can('posts:upvote', id, activitypub._constants.uid);