diff --git a/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java index fc59c85a0a8626f8034577c830f3c3857de0b626..ffe19b80e8878f9aeadedad028860c32a2a4b5fc 100644 --- a/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java +++ b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java @@ -72,11 +72,14 @@ public class S3Client extends DB { */ @Override public void cleanup() throws DBException { - try { - this.s3Client.shutdown(); //this should not be used - //this.s3Client = null; - } catch (Exception e){ - e.printStackTrace(); + if(this.s3Client != null){ + try { + this.s3Client.shutdown(); + } catch (Exception e){ + e.printStackTrace(); + } finally { + this.s3Client = null; + } } } /**