Skip to content

Commit

Permalink
Safely check pointer in aws client before using them. (grafana#3505)
Browse files Browse the repository at this point in the history
It seems that some client might not returns those properties.

see  grafana#2912

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
  • Loading branch information
cyriltovena authored Nov 18, 2020
1 parent 8680148 commit 58b2268
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aws/s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,14 @@ func (a *S3ObjectClient) List(ctx context.Context, prefix, delimiter string) ([]
commonPrefixes = append(commonPrefixes, chunk.StorageCommonPrefix(aws.StringValue(commonPrefix.Prefix)))
}

if !*output.IsTruncated {
if output.IsTruncated == nil || !*output.IsTruncated {
// No more results to fetch
break
}

if output.NextContinuationToken == nil {
// No way to continue
break
}
input.SetContinuationToken(*output.NextContinuationToken)
}

Expand Down

0 comments on commit 58b2268

Please sign in to comment.