Check the comment is defined when validating body
authorChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 17:07:25 +0000 (19:07 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 17:07:25 +0000 (19:07 +0200)
server/helpers/custom-validators/activitypub/video-comments.ts

index 7a9f7326d1fd473bd6024075047054de87f21c44..051c4565abb0fbbe09107fb01eee837535fe9b21 100644 (file)
@@ -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)