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);