Skip to content

Commit

Permalink
Handle issue in eq and neq when any of params is null (#552)
Browse files Browse the repository at this point in the history
Fixes regression made by 59bd121

Closes #551

We have observed that while evaluating neq or eq, the second param might be null. After #498 it started causing NullPointerException so I made a special check for that. Additionally, I allowed the first param to be nullable as well.
  • Loading branch information
osdnk authored Jan 15, 2020
1 parent 952bce2 commit 74beaa3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ public boolean eval(Double x, Double y) {
private static final Operator EQ = new CompOperator() {
@Override
public boolean eval(Double x, Double y) {
if (x == null || y == null) {
return x == y;
}
return x.doubleValue() == y.doubleValue();
}
};
Expand All @@ -213,6 +216,9 @@ public boolean eval(Double x, Double y) {
private static final Operator NEQ = new CompOperator() {
@Override
public boolean eval(Double x, Double y) {
if (x == null || y == null) {
return x == y;
}
return x.doubleValue() != y.doubleValue();
}
};
Expand Down

0 comments on commit 74beaa3

Please sign in to comment.