Skip to content

Commit

Permalink
Prevent NPE on UpgradeSpringFrameworkDependencies.newVersion (#390)
Browse files Browse the repository at this point in the history
* Prevent NPE on `UpgradeSpringFrameworkDependencies.newVersion`

* added test

* missing header

* Delete UpgradeSpringFrameworkDependenciesTest.java

---------

Co-authored-by: joanvr <[email protected]>
  • Loading branch information
timtebeek and joanvr authored Jul 17, 2023
1 parent c40f54e commit 56d60e0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public String getDescription() {
String newVersion;

@Override
public Validated validate() {
Validated validated = super.validate();
public Validated<Object> validate() {
Validated<Object> validated = super.validate();
validated = validated.and(Semver.validate(newVersion, null));
return validated;
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public List<Recipe> getRecipeList() {
for (String artifact : artifacts51) {
result.add(new UpgradeDependencyVersion("org.springframework", artifact, newVersion, null, false, null));
}
if (newVersion.startsWith("5.3")) {
if (newVersion != null && newVersion.startsWith("5.3")) {
result.add(new UpgradeDependencyVersion("org.springframework", "spring-r2dbc", newVersion, null, false, null));
}

Expand Down

0 comments on commit 56d60e0

Please sign in to comment.