diff --git a/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java b/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java index be26f318625..a6e4c70b056 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java @@ -145,6 +145,10 @@ public class BulkProcessor implements Closeable { } public static Builder builder(Client client, Listener listener) { + if (client == null) { + throw new Exception("The client you specified while building a BulkProcessor is null"); + } + return new Builder(client, listener); }