diff --git a/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java b/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java index 4373b0f006..110a3ef5b8 100644 --- a/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java +++ b/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/gremlin/GremlinAPI.java @@ -20,6 +20,7 @@ import org.apache.hugegraph.api.filter.CompressInterceptor.Compress; import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.metrics.MetricsUtil; +import org.apache.hugegraph.util.E; import com.codahale.metrics.Histogram; import com.codahale.metrics.annotation.Timed; @@ -77,6 +78,7 @@ public Response get(@Context HugeConfig conf, @Context UriInfo uriInfo) { String auth = headers.getHeaderString(HttpHeaders.AUTHORIZATION); String query = uriInfo.getRequestUri().getRawQuery(); + E.checkArgumentNotNull(query, "The request query can't be empty"); MultivaluedMap params = uriInfo.getQueryParameters(); Response response = this.client().doGetRequest(auth, params); GREMLIN_INPUT_HISTOGRAM.update(query.length());