sftp: fix initialization bug introduced by fs.ErrorIsDir return
3fbaa4c0b0
backends: make NewObject return fs.ErrorIsDir if possible
This commit is contained in:
parent
54da6154c4
commit
96e14bf456
1 changed files with 1 additions and 1 deletions
|
@ -784,7 +784,7 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m
|
|||
}
|
||||
_, err := f.NewObject(ctx, remote)
|
||||
if err != nil {
|
||||
if err == fs.ErrorObjectNotFound || errors.Cause(err) == fs.ErrorNotAFile {
|
||||
if err == fs.ErrorObjectNotFound || err == fs.ErrorIsDir {
|
||||
// File doesn't exist so return old f
|
||||
f.root = root
|
||||
f.absRoot = oldAbsRoot
|
||||
|
|
Loading…
Reference in a new issue