diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 69e438401c..7e3795fb5a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -228,10 +228,13 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setFunctionalWhenUnactivated(!functionalWhenUnactivatedCheckBox.isSelected()); } - MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); - if (style != null) { - ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + // 在不勾选body移动端属性-手机重布局时,如果修改body内的图表块的移动端属性,会造成这边的npe,因此加个判断 + if (this.mobileCollapsedStyleEditor != null) { + MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); + if (style != null) { + ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + } } DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 }