From 945f68b9b112bfc7156c7c7a4ce7e9b43be36c9a Mon Sep 17 00:00:00 2001 From: wusheng Date: Sun, 2 Jul 2017 21:10:49 +0800 Subject: [PATCH] Allow the context carrier is null when creating entry span. --- .../skywalking/apm/agent/core/context/ContextManager.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextManager.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextManager.java index 87c9b7b17..6a7c96470 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextManager.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextManager.java @@ -77,12 +77,9 @@ public class ContextManager implements TracingContextListener, BootService, Igno } public static AbstractSpan createEntrySpan(String operationName, ContextCarrier carrier) { - if (carrier == null) { - throw new IllegalArgumentException("ContextCarrier can't be null."); - } SamplingService samplingService = ServiceManager.INSTANCE.findService(SamplingService.class); AbstractTracerContext context; - if (carrier.isValid()) { + if (carrier != null && carrier.isValid()) { samplingService.forceSampled(); context = getOrCreate(operationName, true); context.extract(carrier);