From: Chocobozzz Date: Mon, 1 Oct 2018 17:07:25 +0000 (+0200) Subject: Check the comment is defined when validating body X-Git-Tag: v1.0.0-rc.1~17 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c049d791f92cc10f569ee3122edff616cff381f9;p=oweals%2Fpeertube.git Check the comment is defined when validating body --- 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)