From bcec136ee62ee9fcc0f0177e9dd0ac191a2cf5ee Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Jun 2018 14:55:18 +0200 Subject: [PATCH] Fix lint --- server/helpers/custom-validators/activitypub/activity.ts | 2 ++ server/lib/activitypub/process/process-delete.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/helpers/custom-validators/activitypub/activity.ts b/server/helpers/custom-validators/activitypub/activity.ts index 1d2ef2ac6..381a29e66 100644 --- a/server/helpers/custom-validators/activitypub/activity.ts +++ b/server/helpers/custom-validators/activitypub/activity.ts @@ -16,6 +16,7 @@ import { sanitizeAndCheckVideoTorrentUpdateActivity } from './videos' import { isViewActivityValid } from './view' +import { exists } from '../misc' function isRootActivityValid (activity: any) { return Array.isArray(activity['@context']) && ( @@ -26,6 +27,7 @@ function isRootActivityValid (activity: any) { ) || ( isActivityPubUrlValid(activity.id) && + exists(activity.actor) && (isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id)) ) ) diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index ff0caa343..3c830abea 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts @@ -15,7 +15,7 @@ async function processDeleteActivity (activity: ActivityDelete) { if (activity.actor === objectUrl) { let actor = await ActorModel.loadByUrl(activity.actor) - if (!actor) return + if (!actor) return undefined if (actor.type === 'Person') { if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.') @@ -45,7 +45,7 @@ async function processDeleteActivity (activity: ActivityDelete) { } } - return + return undefined } // --------------------------------------------------------------------------- -- 2.25.1