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 ef31035
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 ef31035

Please sign in to comment.