Skip to content

Commit 053241c

Browse files
Fix NPE when trying to get retry analyzer in Test NG (#8253)
1 parent ea4856f commit 053241c

File tree

1 file changed

+3
-0
lines changed
  • dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng

1 file changed

+3
-0
lines changed

dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/TestNGUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ public static boolean wasRetried(ITestResult result) {
216216

217217
public static IRetryAnalyzer getRetryAnalyzer(ITestResult result) {
218218
ITestNGMethod method = result.getMethod();
219+
if (method == null) {
220+
return null;
221+
}
219222
IRetryAnalyzer analyzer = METHOD_HANDLES.invoke(TEST_METHOD_GET_RETRY_ANALYZER, method, result);
220223
if (analyzer != null) {
221224
return analyzer;

0 commit comments

Comments
 (0)