}
function sanitizeAndCheckVideoCommentObject (comment: any) {
- if (comment.type !== 'Note') return false
+ if (!comment || comment.type !== 'Note') return false
normalizeComment(comment)
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
}