diff --git a/amazonclouddrive/amazonclouddrive.go b/amazonclouddrive/amazonclouddrive.go index 48b6eec4d..aadce1670 100644 --- a/amazonclouddrive/amazonclouddrive.go +++ b/amazonclouddrive/amazonclouddrive.go @@ -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 diff --git a/onedrive/onedrive.go b/onedrive/onedrive.go index 459b68391..a8178138c 100644 --- a/onedrive/onedrive.go +++ b/onedrive/onedrive.go @@ -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