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 <[email protected]>
Signed-off-by: Krishna Kondaka <[email protected]>
  • Loading branch information
dlvenable authored and Krishna Kondaka committed Aug 14, 2024
1 parent d2c4ea4 commit 514fb93
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 514fb93

Please sign in to comment.