fix: crash fix.

(cherry picked from commit 5fcfe04fc167a7c707184c6f92422c360622f1ef)
This commit is contained in:
zouxu 2025-03-06 17:40:31 +08:00
parent 2a1e28f5f5
commit b3498b9adb

View File

@ -248,7 +248,9 @@ func (d *Dir) ForgetAll() (hasVirtual bool) {
if !hasVirtual {
d.read = time.Time{}
d.items = make(map[string]Node)
d.cleanupTimer.Stop()
if d.cleanupTimer != nil {
d.cleanupTimer.Stop()
}
} else {
d.cleanupTimer.Reset(time.Duration(d.vfs.Opt.DirCacheTime * 2))
}