mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-05 11:19:14 +02:00
fix: null checks for category sync and actor assertions
This commit is contained in:
@@ -67,7 +67,7 @@ Actors.assert = async (ids, options = {}) => {
|
|||||||
})));
|
})));
|
||||||
|
|
||||||
// Webfinger failures = assertion failure
|
// Webfinger failures = assertion failure
|
||||||
if (!ids.every(Boolean)) {
|
if (!ids.length || !ids.every(Boolean)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ function enabledCheck(next) {
|
|||||||
activitypubApi.follow = enabledCheck(async (caller, { type, id, actor } = {}) => {
|
activitypubApi.follow = enabledCheck(async (caller, { type, id, actor } = {}) => {
|
||||||
// Privilege checks should be done upstream
|
// Privilege checks should be done upstream
|
||||||
const assertion = await activitypub.actors.assert(actor);
|
const assertion = await activitypub.actors.assert(actor);
|
||||||
if (!assertion) {
|
if (!assertion || !assertion.length) {
|
||||||
throw new Error('[[error:activitypub.invalid-id]]');
|
throw new Error('[[error:activitypub.invalid-id]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user