Back to Error Prone

AsyncFunctionReturnsNull

docs/bugpattern/AsyncFunctionReturnsNull.md

2.49.0230 B
Original Source

Methods like Futures.transformAsync and Futures.catchingAsync will throw a NullPointerException if the provided AsyncFunction returns a null Future. To produce a Future with an output of null, instead return immediateFuture(null).