diff --git a/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/grpc/mapper/AnnotationValueMapper.java b/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/grpc/mapper/AnnotationValueMapper.java index 843b0877903d..15286d26220a 100644 --- a/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/grpc/mapper/AnnotationValueMapper.java +++ b/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/grpc/mapper/AnnotationValueMapper.java @@ -139,7 +139,9 @@ default PBytesStringStringValue.Builder getBytesStringStringBuilder() { @ToPAnnotationValue default PAnnotationValue map(Annotation annotation) { if (annotation instanceof NullAnnotation) { - return null; + // Return an empty PAnnotationValue instead of null to avoid NPE in callers + // that unconditionally set the result on a PAnnotation.Builder. + return getAnnotationBuilder().build(); } return mapNonNull(annotation); }