diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 715db1b6a..aa9d5e18b 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -3151,8 +3151,11 @@ func (f *Fs) newV2List(req *s3.ListObjectsV2Input) bucketLister { // Do a V2 listing func (ls *v2List) List(ctx context.Context) (resp *s3.ListObjectsV2Output, versionIDs []*string, err error) { resp, err = ls.f.c.ListObjectsV2WithContext(ctx, &ls.req) + if err != nil { + return nil, nil, err + } ls.req.ContinuationToken = resp.NextContinuationToken - return resp, nil, err + return resp, nil, nil } // URL Encode the listings