fix nil problem
This commit is contained in:
@@ -112,11 +112,12 @@ func GetEntry(ctx context.Context, filerClient FilerClient, fullFilePath string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.Entry != nil {
|
if resp.Entry == nil {
|
||||||
entry = resp.Entry
|
|
||||||
glog.V(3).Infof("read %s entry: %v", fullFilePath, entry)
|
glog.V(3).Infof("read %s entry: %v", fullFilePath, entry)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entry = resp.Entry
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
glog.V(2).Infof("read dir %s attr: %v, error: %v", dir.Path, dir.attributes, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if entry == nil {
|
||||||
|
return fuse.ENOENT
|
||||||
|
}
|
||||||
dir.attributes = entry.Attributes
|
dir.attributes = entry.Attributes
|
||||||
|
|
||||||
glog.V(2).Infof("dir %s: %v perm: %v", dir.Path, dir.attributes, os.FileMode(dir.attributes.FileMode))
|
glog.V(2).Infof("dir %s: %v perm: %v", dir.Path, dir.attributes, os.FileMode(dir.attributes.FileMode))
|
||||||
|
|||||||
Reference in New Issue
Block a user