fs: fix potential panic when chowning a file

This commit is contained in:
Matthew Penner 2021-02-05 13:30:02 -07:00
parent aa287d21cf
commit 683c766d0f

View File

@ -240,7 +240,7 @@ func (fs *Filesystem) Chown(path string) error {
// If this is not a directory we can now return from the function, there is nothing
// left that we need to do.
if st, _ := os.Stat(cleaned); !st.IsDir() {
if st, err := os.Stat(cleaned); err != nil || !st.IsDir() {
return nil
}