From ea6418f46c3fde3215be95fd700306f36d4ef6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 17 Feb 2022 14:19:10 +0800 Subject: [PATCH] REPORT-66884 --- .../com/fr/design/mainframe/FormDesigner.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 0e28ef3b69..2b43265f9a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1991,17 +1991,21 @@ public class FormDesigner extends TargetComponent
implements TreeSelection } public void instantiateCreator(XCreator creator) { - ModelUtil.renameWidgetName(this.getTarget(), creator); - creator.addNotify(); + if (creator != null) { + ModelUtil.renameWidgetName(this.getTarget(), creator); + creator.addNotify(); - ComponentAdapter adapter = new CompositeComponentAdapter(this, creator); - adapter.initialize(); - creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); + ComponentAdapter adapter = new CompositeComponentAdapter(this, creator); + adapter.initialize(); + creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); + } } public void backUpCreator(XCreator creator) { - creator.backupCurrentSize(); - creator.backupParent(); + if (creator != null) { + creator.backupCurrentSize(); + creator.backupParent(); + } } public void addWidgetToForm(XCreator creator, int x, int y) {