Skip to content

Commit

Permalink
fix: Avoid NPE in Kafka Consumer serdes
Browse files Browse the repository at this point in the history
- 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: #2641

Signed-off-by: Andrew Borley <BORLEY@uk.ibm.com>
  • Loading branch information
ajborley authored and carlesarnal committed Jul 27, 2022
1 parent aa2ec65 commit 11d8f03
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -115,7 +115,7 @@ public U deserialize(String topic, Headers headers, byte[] data) {
return null;
}
ArtifactReference artifactReference = null;
if (headers != null) {
if (headersHandler != null && headers != null) {
artifactReference = headersHandler.readHeaders(headers);

if (artifactReference.hasValue()) {
Expand Down

0 comments on commit 11d8f03

Please sign in to comment.