]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/misc.ts
Merge branch 'feature/SO035' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / misc.ts
index 3dc5504e32545d611c3b9a1d325621cd6613c87a..b3ab3ac64704edda06955c18d384df3b2e044017 100644 (file)
@@ -103,7 +103,13 @@ function checkMimetypeRegex (fileMimeType: string, mimeTypeRegex: string) {
 // ---------------------------------------------------------------------------
 
 function toCompleteUUID (value: string) {
-  if (isShortUUID(value)) return shortToUUID(value)
+  if (isShortUUID(value)) {
+    try {
+      return shortToUUID(value)
+    } catch {
+      return null
+    }
+  }
 
   return value
 }