fix: Avoid NPE in Kafka Consumer serdes
Kafka passes an empty, but non-null Headers object to the
Deserializer, which can cause an NPE when the headersHandler
has not been initialized (which occurs when the
`apicurio.registry.headers.enabled` property is set to
false).
Contributes to:
@@ -115,7 +115,7 @@ public abstract class AbstractKafkaDeserializer<T, U> extends AbstractKafkaSerDe
return null;
}
ArtifactReference artifactReference = null;
- if (headers != null) {
+ if (headersHandler != null && headers != null) {
artifactReference = headersHandler.readHeaders(headers);
if (artifactReference.hasValue()) {
