Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1095dd

Browse files
author
石源
committed
NLPchina#540 fix NullPointerException
1 parent 09ea2f5 commit b1095dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.nlpcn</groupId>
55
<artifactId>elasticsearch-sql</artifactId>
6-
<version>5.6.3.3</version>
6+
<version>5.6.3.4</version>
77
<packaging>jar</packaging>
88
<description>Query elasticsearch using SQL</description>
99
<name>elasticsearch-sql</name>

src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.nlpcn.es4sql.query;
22

3+
import java.util.Collections;
34
import java.util.List;
45
import java.util.ArrayList;
56
import org.elasticsearch.action.search.SearchRequestBuilder;
@@ -128,7 +129,7 @@ private void handleScriptField(MethodField method) throws SqlParseException {
128129
if (params.size() == 2) {
129130
request.addScriptField(params.get(0).value.toString(), new Script(params.get(1).value.toString()));
130131
} else if (params.size() == 3) {
131-
request.addScriptField(params.get(0).value.toString(), new Script(ScriptType.INLINE, params.get(1).value.toString(), params.get(2).value.toString(), null));
132+
request.addScriptField(params.get(0).value.toString(), new Script(ScriptType.INLINE, params.get(1).value.toString(), params.get(2).value.toString(), Collections.emptyMap()));
132133
} else {
133134
throw new SqlParseException("scripted_field only allows script(name,script) or script(name,lang,script)");
134135
}

0 commit comments

Comments
 (0)