diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index b21519513c..61093401f2 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -19,6 +19,7 @@ import com.fr.plugin.context.PluginContext; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Collections; @@ -98,6 +99,7 @@ public class HistoryTemplateListCache implements CallbackEvent { } + @Nullable public JTemplate getCurrentEditingTemplate() { return this.editingTemplate; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index aa6d4873e3..ec6a982485 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1088,7 +1088,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jt != null) { + if (JTemplate.isValid(jt)) { DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); }