Skip to content

Commit

Permalink
fix: potential nil pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
  • Loading branch information
microyahoo committed May 29, 2023
1 parent d9e82dc commit dcdaebb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ func fillWorkqueue(testConfig *common.TestCaseConfiguration, Workqueue *Workqueu
var PreExistingObjectCount uint64
if testConfig.ExistingReadWeight > 0 {
PreExistingObjects, err = listObjects(housekeepingSvc, "", bucketName)
PreExistingObjectCount = uint64(len(PreExistingObjects.Contents))
log.Debugf("Found %d objects in bucket %s", PreExistingObjectCount, bucketName)
if err != nil {
log.WithError(err).Fatalf("Problems when listing contents of bucket %s", bucketName)
}
PreExistingObjectCount = uint64(len(PreExistingObjects.Contents))
log.Debugf("Found %d objects in bucket %s", PreExistingObjectCount, bucketName)
}
objectCount := common.EvaluateDistribution(testConfig.Objects.NumberMin, testConfig.Objects.NumberMax, &testConfig.Objects.NumberLast, 1, testConfig.Objects.NumberDistribution)
for object := uint64(0); object < objectCount; object++ {
Expand Down

0 comments on commit dcdaebb

Please sign in to comment.