reactor / reactor-core

Non-Blocking Reactive Foundation for the JVM
http://projectreactor.io
Apache License 2.0
4.99k stars 1.21k forks source link

Fix `Mono#cacheInvalidateIf` NPE when cancelled #3914

Closed chemicL closed 3 weeks ago

chemicL commented 3 weeks ago

When the chain is cancelled during the establishment of the upstream subscription there is a risk that the upstream reference is not yet established. This could lead to NullPointerException being raised. The fix ensures proper cleanup and guards take place and no upstream subscription is issued in such case.

Resolves #3907

chemicL commented 3 weeks ago

@violetagg thank you for the review!