Skip to content

Commit e4eb0ae

Browse files
authored
PHP: [Bug#7535] : Fix message and logic (#7537)
Message Fix
1 parent e720066 commit e4eb0ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/example_code/s3/GettingStartedWithS3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function runExample()
148148
$check = $this->s3client->listObjectsV2([
149149
'Bucket' => $this->bucketName,
150150
]);
151-
if (count($check) <= 0) {
151+
if (isset($check['Contents']) && count($check['Contents']) > 0) {
152152
throw new Exception("Bucket wasn't empty.");
153153
}
154154
echo "Deleted all objects and folders from $this->bucketName.\n";

0 commit comments

Comments
 (0)