Unverified Commit 8152ade1 authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #3419 from xpzouying/close_fs_when_is_not_nil

Close fs when is not nil
parents 6350f8b9 a5a2471f
......@@ -186,13 +186,13 @@ func BuildTemplate(dir string, files ...string) error {
var err error
fs := beeTemplateFS()
f, err := fs.Open(dir)
defer f.Close()
if err != nil {
if os.IsNotExist(err) {
return nil
}
return errors.New("dir open err")
}
defer f.Close()
beeTemplates, ok := beeViewPathTemplates[dir]
if !ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment