Skip to content

Commit a3dc375

Browse files
Null check
1 parent 301d2a0 commit a3dc375

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ private SearchSourceBuilder parseXContent(
14241424
if (token == XContentParser.Token.FIELD_NAME) {
14251425
currentFieldName = parser.currentName();
14261426
} else if (token.isValue()) {
1427-
if (PROJECT_ROUTING.match(currentFieldName, parser.getDeprecationHandler())) {
1427+
if (PROJECT_ROUTING.match(currentFieldName, parser.getDeprecationHandler()) && searchRequest != null) {
14281428
/*
14291429
* If project_routing was specified as a query parameter too, setProjectRouting() will throw
14301430
* an error to prevent setting twice or overwriting previously set value.

0 commit comments

Comments
 (0)