From dcdaebbffa9364f674408483e5242a67bdd58b43 Mon Sep 17 00:00:00 2001 From: Liang Zheng Date: Mon, 29 May 2023 22:57:40 +0800 Subject: [PATCH] fix: potential nil pointer Signed-off-by: Liang Zheng --- worker/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/main.go b/worker/main.go index 2e7d391..b5c0968 100644 --- a/worker/main.go +++ b/worker/main.go @@ -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++ {