提交 3a695cdd 编写于 作者: N ntysdd 提交者: Jia Zhai

fix potential NPE and repeated conditional test (#5776)

### Motivation

fix potential NPE and repeated conditional test

### Modifications

local changes
上级 d74c1acb
......@@ -308,7 +308,7 @@ public class ClientCnx extends PulsarHandler {
@Override
protected void handleAuthChallenge(CommandAuthChallenge authChallenge) {
checkArgument(authChallenge.hasChallenge());
checkArgument(authChallenge.getChallenge().hasAuthData() && authChallenge.getChallenge().hasAuthData());
checkArgument(authChallenge.getChallenge().hasAuthData());
// mutual authn. If auth not complete, continue auth; if auth complete, complete connectionFuture.
try {
......
......@@ -947,7 +947,8 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
}
return true;
} else {
log.warn("[{}] Failed while casting {} into ByteBufPair", producerName, op.cmd.getClass().getName());
log.warn("[{}] Failed while casting {} into ByteBufPair", producerName,
(op.cmd == null ? null : op.cmd.getClass().getName()));
return false;
}
}
......@@ -1253,7 +1254,8 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
headerFrame.resetReaderIndex();
}
} else {
log.warn("[{}] Failed while casting {} into ByteBufPair", producerName, op.cmd.getClass().getName());
log.warn("[{}] Failed while casting {} into ByteBufPair", producerName,
(op.cmd == null ? null : op.cmd.getClass().getName()));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册