Skip to content

Commit

Permalink
fix: prevent NPE in RemoteStorageHelper.cleanBuckets
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 Aug 31, 2020
1 parent 913b756 commit aa8ee3f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -88,7 +88,7 @@ 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 aa8ee3f

Please sign in to comment.