diff --git a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java index c61a4ef3f0d8c..5f1592a98af5c 100644 --- a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java @@ -251,7 +251,7 @@ public ShardSearchRequest( this.waitForCheckpoint = waitForCheckpoint; this.waitForCheckpointsTimeout = waitForCheckpointsTimeout; this.forceSyntheticSource = forceSyntheticSource; - this.innerHitsDisabled = source.innerHitsDisabled(); + this.innerHitsDisabled = source != null && source.innerHitsDisabled(); } @SuppressWarnings("this-escape")