From 9c781da34ae8e80f9ade844909c2b4d82e340faa Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Dec 2019 15:08:38 -0800 Subject: [PATCH] mount: fix nil directory problem --- weed/filesys/dir.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index d5c3cd85f..d8d098df4 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -186,7 +186,9 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. if err != nil { return nil, err } - dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute) + if entry != nil { + dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute) + } } else { glog.V(4).Infof("dir Lookup cache hit %s", fullFilePath) }