Skip to content

Commit

Permalink
fix: fix problem with OptionalOrder null from getOptional()
Browse files Browse the repository at this point in the history
  • Loading branch information
APayerl committed May 9, 2024
1 parent 9edcd29 commit ef4bd0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/se/payerl/OptionalOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.apache.maven.model.Dependency;

import java.util.List;
import java.util.Objects;

public class OptionalOrder extends SortOrder<OptionalOrder> {
String first;
Expand All @@ -11,7 +12,7 @@ public class OptionalOrder extends SortOrder<OptionalOrder> {
public OptionalOrder() { }

private String getOptional(Dependency dep) {
return dep.getOptional().equalsIgnoreCase("true") ? "true" : "false";
return Boolean.toString(Objects.equals(dep.getOptional(), "true"));
}

@Override
Expand Down

0 comments on commit ef4bd0e

Please sign in to comment.