diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..b98c2a952d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -433,7 +433,11 @@ public class XWAbsoluteLayout extends XLayoutContainer { @Override public XLayoutContainer getTopLayout() { - XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); + XLayoutContainer parentXLayoutContainer = XCreatorUtils.getParentXLayoutContainer(this); + if (parentXLayoutContainer == null) { + return this; + } + XLayoutContainer xTopLayout = parentXLayoutContainer.getTopLayout(); if (xTopLayout != null && !xTopLayout.isEditable()) { return xTopLayout; } else { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 85ec9474db..46377b1adf 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -17,6 +17,9 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { + if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + return false; + } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); }