mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01: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
|
||||
if (!ids.every(Boolean)) {
|
||||
if (!ids.length || !ids.every(Boolean)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ function enabledCheck(next) {
|
||||
activitypubApi.follow = enabledCheck(async (caller, { type, id, actor } = {}) => {
|
||||
// Privilege checks should be done upstream
|
||||
const assertion = await activitypub.actors.assert(actor);
|
||||
if (!assertion) {
|
||||
if (!assertion || !assertion.length) {
|
||||
throw new Error('[[error:activitypub.invalid-id]]');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user