Skip to content

Commit

Permalink
onedrive: fix error listing: unknown object type <nil>
Browse files Browse the repository at this point in the history
This error was introduced in this commit when refactoring the list
routine.

b8591b2 onedrive: implement ListR method which gives --fast-list support

The error was caused by OneNote files not being skipped properly.
  • Loading branch information
ncw committed Dec 2, 2023
1 parent 08c460d commit f0c7741
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backend/onedrive/onedrive.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,10 +1241,14 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
}
err = f.listAll(ctx, directoryID, false, false, func(info *api.Item) error {
entry, err := f.itemToDirEntry(ctx, dir, info)
if err == nil {
entries = append(entries, entry)
if err != nil {
return err
}
return err
if entry == nil {
return nil
}
entries = append(entries, entry)
return nil
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -1339,6 +1343,9 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (
if err != nil {
return err
}
if entry == nil {
return nil
}
err = list.Add(entry)
if err != nil {
return err
Expand Down

0 comments on commit f0c7741

Please sign in to comment.