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 c4fa2df8a..a80032ed6 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 @@ -619,8 +619,9 @@ public class FormDesigner extends TargetComponent
implements TreeSelection if (paraComponent != null && paraComponent.acceptType(XWParameterLayout.class)) { return true; } else { - if (this.getSelectionModel().getSelection().getSelectedCreator().getParent() != null - && ((XLayoutContainer) this.getSelectionModel().getSelection().getSelectedCreator().getParent()).acceptType(XWAbsoluteLayout.class)) { + XCreator creator = this.getSelectionModel().getSelection().getSelectedCreator(); + if (creator != null && creator.getParent() != null + && ((XLayoutContainer) creator.getParent()).acceptType(XWAbsoluteLayout.class)) { return true; } } @@ -1337,6 +1338,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection // 当前选中控件可以上移一层吗? public boolean isCurrentComponentMovableUp() { XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); + if (null == creator) { + return false; + } XLayoutContainer container = (XLayoutContainer) creator.getParent(); if (container == null || !container.supportInnerOrderChangeActions()) { return false; @@ -1347,6 +1351,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection // 当前选中控件可以下移一层吗? public boolean isCurrentComponentMovableDown() { XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); + if (null == creator) { + return false; + } XLayoutContainer container = (XLayoutContainer) creator.getParent(); if (container == null || !container.supportInnerOrderChangeActions()) { return false;