Skip to content

Commit

Permalink
Fix play-mvc\methods NullPointerException (#12121)
Browse files Browse the repository at this point in the history
  • Loading branch information
huange7 authored Aug 28, 2024
1 parent cdd8bba commit 3bcbacc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public static void stopSpan(
@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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public static void stopTraceOnResponse(
@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public static void stopTraceOnResponse(
@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);
Expand Down

0 comments on commit 3bcbacc

Please sign in to comment.