Skip to content

Commit 582fdae

Browse files
jroperviktorklang
authored andcommitted
Fix NPE for null failed processor in IdentityFlowProcessorVerification
Fixes #425 IdentityFlowProcessorVerification.createFailedProcessor is allowed to return null, but the TCK throws an NPE if it does. This introduces a null check to ensure that doesn't happen.
1 parent 0a47f63 commit 582fdae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CopyrightWaivers.txt

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ patriknw | Patrik Nordwall, [email protected], Lightbend Inc
4141
angelsanz | Ángel Sanz, [email protected]
4242
shenghaiyang | 盛海洋, [email protected]
4343
kiiadi | Kyle Thomson, [email protected], Amazon.com
44+
jroper | James Roper, [email protected], Lightbend Inc.

tck-flow/src/main/java/org/reactivestreams/tck/flow/IdentityFlowProcessorVerification.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public final Processor<T, T> createIdentityProcessor(int bufferSize) {
6060

6161
@Override
6262
public final Publisher<T> createFailedPublisher() {
63-
return FlowAdapters.toPublisher(createFailedFlowPublisher());
63+
Flow.Publisher<T> failed = createFailedFlowPublisher();
64+
if (failed == null) return null; // because `null` means "SKIP" in createFailedPublisher
65+
else return FlowAdapters.toPublisher(failed);
6466
}
6567

6668
}

0 commit comments

Comments
 (0)