Skip to content

Commit 7f67140

Browse files
Remove log if bucket does not exist
1 parent cf27a61 commit 7f67140

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/io/cdap/plugin/gcp/bigquery/util/BigQueryUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,11 @@ public static void deleteTemporaryDirectory(Configuration configuration, String
766766
/**
767767
* Deletes the GCS bucket.
768768
*/
769-
public static void deleteGcsBucket(Storage storage, String bucket) {
769+
public static void deleteGcsBucket(Storage storage, @Nullable String bucket) {
770+
if (Strings.isNullOrEmpty(bucket) || storage.get(bucket) == null) {
771+
return;
772+
}
773+
770774
Page<Blob> blobs = storage.list(bucket, Storage.BlobListOption.versions(true));
771775
List<BlobId> blobIds = new ArrayList<>();
772776
for (Blob blob : blobs.iterateAll()) {

0 commit comments

Comments
 (0)