Skip to content

Commit 135e0f0

Browse files
Ensure callback provider is not null
1 parent d204d79 commit 135e0f0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dd-java-agent/instrumentation/play-2.4/src/main/java_play25/datadog/trace/instrumentation/play25/appsec/StatusHeaderSendJsonAdvice.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static void after(
3838
}
3939

4040
CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC);
41+
if (cbp == null) {
42+
return;
43+
}
4144
BiFunction<RequestContext, Object, Flow<Void>> callback =
4245
cbp.getCallback(EVENTS.responseBody());
4346
if (callback == null) {

dd-java-agent/instrumentation/play-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/StatusHeaderInstrumentation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ static void after(
7575
}
7676

7777
CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC);
78+
if (cbp == null) {
79+
return;
80+
}
7881
BiFunction<RequestContext, Object, Flow<Void>> callback =
7982
cbp.getCallback(EVENTS.responseBody());
8083
if (callback == null) {

0 commit comments

Comments
 (0)