From c049d791f92cc10f569ee3122edff616cff381f9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 Oct 2018 19:07:25 +0200 Subject: Check the comment is defined when validating body --- server/helpers/custom-validators/activitypub/video-comments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/helpers/custom-validators/activitypub/video-comments.ts') diff --git a/server/helpers/custom-validators/activitypub/video-comments.ts b/server/helpers/custom-validators/activitypub/video-comments.ts index 7a9f7326d..051c4565a 100644 --- a/server/helpers/custom-validators/activitypub/video-comments.ts +++ b/server/helpers/custom-validators/activitypub/video-comments.ts @@ -9,7 +9,7 @@ function isVideoCommentCreateActivityValid (activity: any) { } function sanitizeAndCheckVideoCommentObject (comment: any) { - if (comment.type !== 'Note') return false + if (!comment || comment.type !== 'Note') return false normalizeComment(comment) -- cgit v1.2.3