mirror of https://github.com/apache/kafka.git
MINOR: Fix potential NPE (#17541)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
b917b85e62
commit
eb897c6ad5
|
@ -1209,7 +1209,7 @@ public class ValuesTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SchemaAndValue roundTrip(Schema desiredSchema, SchemaAndValue input) {
|
protected SchemaAndValue roundTrip(Schema desiredSchema, SchemaAndValue input) {
|
||||||
String serialized = Values.convertToString(input.schema(), input.value());
|
String serialized = input != null ? Values.convertToString(input.schema(), input.value()) : null;
|
||||||
if (input != null && input.value() != null) {
|
if (input != null && input.value() != null) {
|
||||||
assertNotNull(serialized);
|
assertNotNull(serialized);
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,7 @@ public class ConsumerGroup extends ModernGroup<ConsumerGroupMember> {
|
||||||
* @param oldMember The member to remove.
|
* @param oldMember The member to remove.
|
||||||
*/
|
*/
|
||||||
private void removeStaticMember(ConsumerGroupMember oldMember) {
|
private void removeStaticMember(ConsumerGroupMember oldMember) {
|
||||||
if (oldMember.instanceId() != null) {
|
if (oldMember != null && oldMember.instanceId() != null) {
|
||||||
staticMembers.remove(oldMember.instanceId());
|
staticMembers.remove(oldMember.instanceId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue