X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fhelpers%2Fcustom-validators%2Fvideos.ts;h=002324fe01ebfdb661d9be31968662dda542d7d5;hb=2efd32f697549c59337db5177a93749af8e605d8;hp=c35db49ac426dee63418b352d437a4af2d543e04;hpb=17c49e60b367868c80f44b9921793dc3a2d9adaa;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index c35db49ac..002324fe0 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts @@ -57,9 +57,11 @@ function isVideoTagValid (tag: string) { } function isVideoTagsValid (tags: string[]) { - return isArray(tags) && - validator.isInt(tags.length.toString(), VIDEOS_CONSTRAINTS_FIELDS.TAGS) && - tags.every(tag => isVideoTagValid(tag)) + return tags === null || ( + isArray(tags) && + validator.isInt(tags.length.toString(), VIDEOS_CONSTRAINTS_FIELDS.TAGS) && + tags.every(tag => isVideoTagValid(tag)) + ) } function isVideoAbuseReasonValid (value: string) {