fix nil problem

This commit is contained in:
Chris Lu
2019-12-10 23:13:14 -08:00
parent 356bd1b629
commit 40ff4eea14
2 changed files with 6 additions and 2 deletions

View File

@@ -56,6 +56,9 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error {
glog.V(2).Infof("read dir %s attr: %v, error: %v", dir.Path, dir.attributes, err)
return err
}
if entry == nil {
return fuse.ENOENT
}
dir.attributes = entry.Attributes
glog.V(2).Infof("dir %s: %v perm: %v", dir.Path, dir.attributes, os.FileMode(dir.attributes.FileMode))