From 70353452cc269d90a818a82699b3476eac3a1ca3 Mon Sep 17 00:00:00 2001 From: Vinicius Goulart Date: Wed, 3 Jul 2024 19:53:12 +0200 Subject: [PATCH] fix: Prevent drag and drop from accessing prop when undefined --- packages/form-js-editor/src/features/dragging/Dragging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/form-js-editor/src/features/dragging/Dragging.js b/packages/form-js-editor/src/features/dragging/Dragging.js index bf937002b..2ba342048 100644 --- a/packages/form-js-editor/src/features/dragging/Dragging.js +++ b/packages/form-js-editor/src/features/dragging/Dragging.js @@ -78,8 +78,8 @@ export class Dragging { let targetParentId; if (formFieldNode) { - formField = this._formFieldRegistry.get(formFieldNode.dataset.id); - columns = (formField.layout || {}).columns; + formField = this._formFieldRegistry.get(formFieldNode.dataset.id) || { layout: {} }; + columns = formField.layout.columns; // (1) check for row constraints if (isRow(target)) {