diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 1ccc073031..d8bc7fb483 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -406,8 +406,11 @@ public abstract class JTemplate> } private void setTargetByFile(FILE file) { - this.template = JTemplateFactory.asIOFile(file, this.suffix()); - setTarget(this.template); + T newTemplate = JTemplateFactory.asIOFile(file, this.suffix()); + if (newTemplate != null) { + this.template = newTemplate; + setTarget(this.template); + } } private void addCenterPane() {