Skip to content

Commit 2171251

Browse files
committed
Merge pull request #223 from mziccard/fix-npe-itstoragetest-afterclass
Check storage not null before deleting bucket in ITStorageTest
2 parents 234f964 + c23b9a2 commit 2171251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcloud-java-storage/src/test/java/com/google/gcloud/storage/ITStorageTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static void beforeClass() {
6666
@AfterClass
6767
public static void afterClass()
6868
throws ExecutionException, TimeoutException, InterruptedException {
69-
if (!RemoteGcsHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS)) {
69+
if (storage != null && !RemoteGcsHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS)) {
7070
if (log.isLoggable(Level.WARNING)) {
7171
log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", bucket);
7272
}

0 commit comments

Comments
 (0)