fix nil pointer in s3 list api

Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2024-07-19 15:12:54 +02:00 committed by GitHub
parent 252619876a
commit 8619a11f73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -874,7 +874,10 @@ func (d *driver) List(ctx context.Context, opath string) ([]string, error) {
directories = append(directories, strings.Replace(commonPrefix[0:len(commonPrefix)-1], d.s3Path(""), prefix, 1))
}
if *resp.IsTruncated {
if resp.IsTruncated == nil || !*resp.IsTruncated {
break
}
resp, err = d.S3.ListObjectsV2WithContext(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String(d.Bucket),
Prefix: aws.String(d.s3Path(path)),
@ -885,9 +888,6 @@ func (d *driver) List(ctx context.Context, opath string) ([]string, error) {
if err != nil {
return nil, err
}
} else {
break
}
}
if opath != "/" {