diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/AsyncExceptionUnwrapper.java b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/AsyncExceptionUnwrapper.java index 8d563ea77c2..f0d350f1b6d 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/AsyncExceptionUnwrapper.java +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/AsyncExceptionUnwrapper.java @@ -8,7 +8,7 @@ private AsyncExceptionUnwrapper() {} // Util function to unwrap CompletionException and expose underlying exception public static Throwable unwrap(Throwable throwable) { - if (throwable.getCause() != null && throwable instanceof CompletionException) { + if (throwable instanceof CompletionException && throwable.getCause() != null) { return throwable.getCause(); } return throwable;