Fix crash when an app with a null name exists

This commit is contained in:
Andrew Kingston 2022-01-24 19:06:41 +00:00
parent bed1f0e092
commit 4d9e7cac31
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@
"Another app with the same name already exists", "Another app with the same name already exists",
value => { value => {
return !existingAppNames.some( return !existingAppNames.some(
appName => dirty && appName.toLowerCase() === value.toLowerCase() appName => dirty && appName?.toLowerCase() === value.toLowerCase()
) )
} }
) )
@ -67,7 +67,7 @@
try { try {
await obj.validate(values, { abortEarly: false }) await obj.validate(values, { abortEarly: false })
} catch (validationErrors) { } catch (validationErrors) {
validationErrors.inner.forEach(error => { validationErrors.inner?.forEach(error => {
$errors[error.path] = capitalise(error.message) $errors[error.path] = capitalise(error.message)
}) })
} }