From 071e1581c06e828b71b664246a5c7d041608fb90 Mon Sep 17 00:00:00 2001 From: Shelby Huang <1048461654@qq.com> Date: Mon, 26 Aug 2024 17:30:14 +0800 Subject: [PATCH] Fix rabbitmq NullPointerException --- .../instrumentation/rabbitmq/RabbitChannelInstrumentation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelInstrumentation.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelInstrumentation.java index 89ccfd232a9a..99b4861ac6ae 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelInstrumentation.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitChannelInstrumentation.java @@ -128,6 +128,9 @@ public static void stopSpan( if (callDepth.decrementAndGet() > 0) { return; } + if (scope == null) { + return; + } scope.close();