mirror of
https://github.com/rclone/rclone.git
synced 2025-02-02 11:39:33 +01:00
acd, onedrive: make sure we have found the root before purging
If we don't, purge can try to trash the root node which fortunately doesn't succeed.
This commit is contained in:
parent
1fa258c2b4
commit
0604d3dbf2
@ -753,6 +753,10 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
||||
return errors.New("can't purge root directory")
|
||||
}
|
||||
dc := f.dirCache
|
||||
err := dc.FindRoot(false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rootID, err := dc.FindDir(dir, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -491,6 +491,10 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
||||
return errors.New("can't purge root directory")
|
||||
}
|
||||
dc := f.dirCache
|
||||
err := dc.FindRoot(false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rootID, err := dc.FindDir(dir, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user