Skip to content

Commit

Permalink
Fixes a regex expression bug. When the left-hand side of the operatio…
Browse files Browse the repository at this point in the history
…n is null, always return false rather than throwing an exception. Resolves opensearch-project#4763. (opensearch-project#4798)

Signed-off-by: David Venable <dlv@amazon.com>
  • Loading branch information
dlvenable committed Aug 12, 2024
1 parent 1ddebf6 commit 176d828
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public int getSymbol() {
@Override
public Boolean evaluate(final Object ... args) {
checkArgument(args.length == 2, displayName + " requires operands length needs to be 2.");
if(args[0] == null)
return false;
checkArgument(args[0] instanceof String, displayName + " requires left operand to be String.");
checkArgument(args[1] instanceof String, displayName + " requires right operand to be String.");
try {
Expand Down
Loading

0 comments on commit 176d828

Please sign in to comment.