Ensure NPE will not be thrown when cancelling a subscription
Issue: SPR-15393
This commit is contained in:
committed by
Arjen Poutsma
parent
dea4825a9f
commit
2556178422
@@ -98,7 +98,9 @@ public abstract class AbstractListenerWriteFlushProcessor<T> implements Processo
|
||||
* Listeners can call this method to cancel further writing.
|
||||
*/
|
||||
protected void cancel() {
|
||||
this.subscription.cancel();
|
||||
if (this.subscription != null) {
|
||||
this.subscription.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,9 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
|
||||
* Listeners can call this method to cancel further writing.
|
||||
*/
|
||||
public void cancel() {
|
||||
this.subscription.cancel();
|
||||
if (this.subscription != null) {
|
||||
this.subscription.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user