From d16f9784e46c5a60f56719ef2c42facc2db17ec3 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Tue, 10 Mar 2020 11:05:17 +0800 Subject: [PATCH] Fix: nil pointer in crontab --- pkg/crontab/collect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crontab/collect.go b/pkg/crontab/collect.go index b247f9b..6d504bc 100644 --- a/pkg/crontab/collect.go +++ b/pkg/crontab/collect.go @@ -30,7 +30,7 @@ func collectArchiveFile() { // 列出文件 root := filepath.Join(tempPath, "archive") err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if !info.IsDir() && + if err != nil && !info.IsDir() && strings.HasPrefix(filepath.Base(path), "archive_") && time.Now().Sub(info.ModTime()).Seconds() > float64(expires) { util.Log().Debug("删除过期打包下载临时文件 [%s]", path)