Skip to content

Commit

Permalink
fix: prevent NPE in RemoteStorageHelper.cleanBuckets (#492)
Browse files Browse the repository at this point in the history
The method getEventBasedHold and getTemporaryHold return Boolean objects
which are either true, false or null. In case of a null value, this
produced a NPE.
  • Loading branch information
Gerschtli committed Sep 1, 2020
1 parent 0e4f70f commit db358c8
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -88,7 +88,8 @@ public void run() {
Storage.BlobField.EVENT_BASED_HOLD,
Storage.BlobField.TEMPORARY_HOLD))
.iterateAll()) {
if (blob.getEventBasedHold() == true || blob.getTemporaryHold() == true) {
if (Boolean.TRUE.equals(blob.getEventBasedHold())
|| Boolean.TRUE.equals(blob.getTemporaryHold())) {
storage.update(
blob.toBuilder().setTemporaryHold(false).setEventBasedHold(false).build(),
Storage.BlobTargetOption.userProject(
Expand Down

0 comments on commit db358c8

Please sign in to comment.