From 28b1f329fa00ab08b7e61c57f3b0ea5264bc9759 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Wed, 3 Jul 2024 10:43:18 -0300 Subject: [PATCH] Fixes potential NPE while reading annotations --- .../org/jboss/logging/processor/apt/MessageMethodBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/org/jboss/logging/processor/apt/MessageMethodBuilder.java b/processor/src/main/java/org/jboss/logging/processor/apt/MessageMethodBuilder.java index 443e50c..6195c0c 100644 --- a/processor/src/main/java/org/jboss/logging/processor/apt/MessageMethodBuilder.java +++ b/processor/src/main/java/org/jboss/logging/processor/apt/MessageMethodBuilder.java @@ -370,7 +370,8 @@ public Set parameters() { @Override public Set parametersAnnotatedWith(final Class annotation) { final TypeElement type = ElementHelper.toTypeElement(elements, annotation); - return parameters.containsKey(type.asType()) ? Collections.unmodifiableSet(parameters.get(type.asType())) + return (type != null && parameters.containsKey(type.asType())) + ? Collections.unmodifiableSet(parameters.get(type.asType())) : Collections.emptySet(); }