diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 98212e27a..c622c7ba7 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -668,7 +668,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck } remote := file.Name[len(prefix):] // Check for directory - isDirectory := strings.HasSuffix(remote, "/") + isDirectory := remote == "" || strings.HasSuffix(remote, "/") if isDirectory { remote = remote[:len(remote)-1] }