]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/video-comments.ts
Add totalLocalVideoFilesSize in stats
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / video-comments.ts
index 151d13075a8ced9bd3d43149010d39df29f25675..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)
 
@@ -46,7 +46,7 @@ function isCommentContentValid (content: any) {
 function normalizeComment (comment: any) {
   if (!comment) return
 
-  if (!comment.url || typeof comment.url !== 'string') {
+  if (typeof comment.url !== 'string') {
     comment.url = comment.url.href || comment.url.url
   }