Fix play-mvc\methods NullPointerException (#12121)
This commit is contained in:
parent
cdd8bbab5a
commit
3bcbacc8d2
|
@ -79,6 +79,9 @@ public class MethodInstrumentation implements TypeInstrumentation {
|
|||
@Advice.Local("otelScope") Scope scope,
|
||||
@Advice.Return(typing = Assigner.Typing.DYNAMIC, readOnly = false) Object returnValue,
|
||||
@Advice.Thrown Throwable throwable) {
|
||||
if (scope == null) {
|
||||
return;
|
||||
}
|
||||
scope.close();
|
||||
|
||||
returnValue =
|
||||
|
|
|
@ -71,6 +71,9 @@ public class ActionInstrumentation implements TypeInstrumentation {
|
|||
@Advice.Return(readOnly = false) Future<Result> responseFuture,
|
||||
@Advice.Local("otelContext") Context context,
|
||||
@Advice.Local("otelScope") Scope scope) {
|
||||
if (scope == null) {
|
||||
return;
|
||||
}
|
||||
scope.close();
|
||||
|
||||
updateSpan(context, req);
|
||||
|
|
|
@ -71,6 +71,9 @@ public class ActionInstrumentation implements TypeInstrumentation {
|
|||
@Advice.Return(readOnly = false) Future<Result> responseFuture,
|
||||
@Advice.Local("otelContext") Context context,
|
||||
@Advice.Local("otelScope") Scope scope) {
|
||||
if (scope == null) {
|
||||
return;
|
||||
}
|
||||
scope.close();
|
||||
|
||||
updateSpan(context, req);
|
||||
|
|
Loading…
Reference in New Issue