fix: null checks for category sync and actor assertions

This commit is contained in:
Julian Lam
2025-01-24 23:41:19 -05:00
parent 4a827b7e70
commit b3b8b9e98d
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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]]');
}