Skip to content

Commit

Permalink
fix: potential NPE in EnsureSIngleStorageVersionDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel authored and manusa committed May 19, 2021
1 parent 45cfa83 commit 76e1762
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void andThenVisit(CustomResourceDefinitionSpecFluent<?> spec, ObjectMeta
}

for (CustomResourceDefinitionVersion version : spec.buildVersions()) {
if (version.getStorage()) {
if (version.getStorage() != null && version.getStorage()) {
String existing = storageVersion.get();
if (existing != null && !existing.equals(version.getName())) {
throw new IllegalStateException(String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void andThenVisit(CustomResourceDefinitionSpecFluent<?> spec, ObjectMeta
}

for (CustomResourceDefinitionVersion version : spec.buildVersions()) {
if (version.getStorage()) {
if (version.getStorage() != null && version.getStorage()) {
String existing = storageVersion.get();
if (existing != null && !existing.equals(version.getName())) {
throw new IllegalStateException(String.format(
Expand Down

0 comments on commit 76e1762

Please sign in to comment.