fix issue with stepNames being undefined

This commit is contained in:
Peter Clement 2023-11-06 10:06:32 +00:00
parent d3a1d48743
commit 7b7b2a12ea
1 changed files with 5 additions and 3 deletions

View File

@ -58,9 +58,11 @@
}
const getAutomationNameError = name => {
for (const [key, value] of Object.entries(stepNames)) {
if (name === value && key !== block.id) {
return "This name already exists, please enter a unique name"
if (stepNames) {
for (const [key, value] of Object.entries(stepNames)) {
if (name === value && key !== block.id) {
return "This name already exists, please enter a unique name"
}
}
}