From ded68a97600d70fb8bbadfbddac87eadb1233910 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Dec 2022 14:42:48 +0100 Subject: [PATCH] More robust short to complete uuid error handler --- server/helpers/custom-validators/misc.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { // --------------------------------------------------------------------------- function toCompleteUUID (value: string) { - if (isShortUUID(value)) return shortToUUID(value) + if (isShortUUID(value)) { + try { + return shortToUUID(value) + } catch { + return null + } + } return value } -- 2.41.0