Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
Signed-off-by: zhichao-aws <[email protected]>
  • Loading branch information
zhichao-aws committed Sep 25, 2023
1 parent 791c6ca commit 6878c01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static void validateForRewrite(String queryText, String modelId) {
}

private static void validateFieldType(MappedFieldType fieldType) {
if (!fieldType.typeName().equals("rank_features")) {
if (null == fieldType || !fieldType.typeName().equals("rank_features")) {
throw new IllegalArgumentException(
"[" + NAME + "] query only works on [rank_features] fields, " + "not [" + fieldType.typeName() + "]"
);
Expand Down

0 comments on commit 6878c01

Please sign in to comment.