< prev index next >

src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java

Print this page

        

@@ -60,11 +60,11 @@
         private Flow.Subscription subscription;
         private final CompletableFuture<Void> result = new MinimalFuture<>();
         private final AtomicBoolean subscribed = new AtomicBoolean();
 
         ConsumerSubscriber(Consumer<Optional<byte[]>> consumer) {
-            this.consumer = consumer;
+            this.consumer = Objects.requireNonNull(consumer);
         }
 
         @Override
         public CompletionStage<Void> getBody() {
             return result;
< prev index next >