optional chaining for backend ui models

This commit is contained in:
Martin McKeaveney 2020-10-13 15:40:59 +01:00
parent c0d5be49f6
commit 8bac014955
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@
function checkValid(evt) {
const tableName = evt.target.value
if ($backendUiStore.models.some(model => model.name === tableName)) {
if ($backendUiStore.models?.some(model => model.name === tableName)) {
error = `Table with name ${tableName} already exists. Please choose another name.`
return
}

View File

@ -44,7 +44,7 @@
function checkValid(evt) {
const tableName = evt.target.value
if (originalName !== tableName && $backendUiStore.models.some(model => model.name === tableName)) {
if (originalName !== tableName && $backendUiStore.models?.some(model => model.name === tableName)) {
error = `Table with name ${tableName} already exists. Please choose another name.`
return
}