Don't access id when editing a shell without a VariableDeclaration (#7232)

This commit is contained in:
Frank Noirot
2025-05-27 14:20:32 -04:00
committed by GitHub
parent 8bae76000c
commit 91b6db0ba5

View File

@ -2803,7 +2803,10 @@ export const modelingMachine = setup({
nodeToEdit,
'VariableDeclaration'
)
if (err(variableNode)) {
if (
err(variableNode) ||
variableNode.node.type !== 'VariableDeclaration'
) {
console.error('Error extracting name')
} else {
variableName = variableNode.node.declaration.id.name