diff options
author | Chocobozzz <me@florianbigard.com> | 2022-12-28 14:42:48 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-12-28 14:42:48 +0100 |
commit | ded68a97600d70fb8bbadfbddac87eadb1233910 (patch) | |
tree | 263a5909c6cc491177d135b6f0eff2a38a6974cb /server/helpers/custom-validators | |
parent | 7a07da01c4009cf0697ec5cfa78e32b187b0e8b6 (diff) | |
download | PeerTube-ded68a97600d70fb8bbadfbddac87eadb1233910.tar.gz PeerTube-ded68a97600d70fb8bbadfbddac87eadb1233910.tar.zst PeerTube-ded68a97600d70fb8bbadfbddac87eadb1233910.zip |
More robust short to complete uuid error handler
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/misc.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 3dc5504e3..b3ab3ac64 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts | |||
@@ -103,7 +103,13 @@ function checkMimetypeRegex (fileMimeType: string, mimeTypeRegex: string) { | |||
103 | // --------------------------------------------------------------------------- | 103 | // --------------------------------------------------------------------------- |
104 | 104 | ||
105 | function toCompleteUUID (value: string) { | 105 | function toCompleteUUID (value: string) { |
106 | if (isShortUUID(value)) return shortToUUID(value) | 106 | if (isShortUUID(value)) { |
107 | try { | ||
108 | return shortToUUID(value) | ||
109 | } catch { | ||
110 | return null | ||
111 | } | ||
112 | } | ||
107 | 113 | ||
108 | return value | 114 | return value |
109 | } | 115 | } |