More robust short to complete uuid error handler

pull/5486/head
Chocobozzz 2022-12-28 14:42:48 +01:00
parent 7a07da01c4
commit ded68a9760
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 7 additions and 1 deletions

View 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
}