Fix npe with pulsar and ssl (#9166)

This commit is contained in:
Lauri Tulmin 2023-08-09 15:07:36 +03:00 committed by GitHub
parent 54d0e0718f
commit 6eec23c00b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ public final class NettySslInstrumentationHandler extends ChannelDuplexHandler {
promise.addListener( promise.addListener(
future -> { future -> {
// there won't be any SSL handshake if the channel fails to connect // there won't be any SSL handshake if the channel fails to connect
if (!future.isSuccess()) { // give up when channelRegistered wasn't called and parentContext is null
if (!future.isSuccess() || parentContext == null) {
return; return;
} }
request = NettySslRequest.create(ctx.channel()); request = NettySslRequest.create(ctx.channel());