Skip to content

Commit 6565a22

Browse files
SunnyBoy-WYHVGalaxies
authored andcommitted
fix(server): add tip for gremlin api NPE with empty query (#2467)
fix #2426
1 parent a199534 commit 6565a22

File tree

1 file changed

+2
-0
lines changed
  • hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin

1 file changed

+2
-0
lines changed

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.hugegraph.api.filter.CompressInterceptor.Compress;
2121
import org.apache.hugegraph.config.HugeConfig;
2222
import org.apache.hugegraph.metrics.MetricsUtil;
23+
import org.apache.hugegraph.util.E;
2324

2425
import com.codahale.metrics.Histogram;
2526
import com.codahale.metrics.annotation.Timed;
@@ -77,6 +78,7 @@ public Response get(@Context HugeConfig conf,
7778
@Context UriInfo uriInfo) {
7879
String auth = headers.getHeaderString(HttpHeaders.AUTHORIZATION);
7980
String query = uriInfo.getRequestUri().getRawQuery();
81+
E.checkArgumentNotNull(query, "The request query can't be empty");
8082
MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
8183
Response response = this.client().doGetRequest(auth, params);
8284
GREMLIN_INPUT_HISTOGRAM.update(query.length());

0 commit comments

Comments
 (0)