Reject null for returned CompletableFuture (avoiding subsequent NPE)
See gh-34708
This commit is contained in:
parent
e33adadc62
commit
00399dc1b3
|
@ -463,7 +463,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||||
() -> {
|
() -> {
|
||||||
CompletableFuture<?> invokeResult = ((CompletableFuture<?>) invokeOperation(invoker));
|
CompletableFuture<?> invokeResult = ((CompletableFuture<?>) invokeOperation(invoker));
|
||||||
if (invokeResult == null) {
|
if (invokeResult == null) {
|
||||||
return null;
|
throw new IllegalStateException("Returned CompletableFuture must not be null: " + method);
|
||||||
}
|
}
|
||||||
return invokeResult.exceptionallyCompose(ex -> {
|
return invokeResult.exceptionallyCompose(ex -> {
|
||||||
invokeFailure.set(true);
|
invokeFailure.set(true);
|
||||||
|
|
Loading…
Reference in New Issue