diff --git a/pom.xml b/pom.xml index 2d9ef8d..3cfb8b1 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ org.tap4j tap4j - 4.0.7 + 4.0.8 diff --git a/src/main/java/org/tap4j/plugin/TapResult.java b/src/main/java/org/tap4j/plugin/TapResult.java index dc12acc..04ec59d 100644 --- a/src/main/java/org/tap4j/plugin/TapResult.java +++ b/src/main/java/org/tap4j/plugin/TapResult.java @@ -362,9 +362,11 @@ public void doDownloadAttachment(StaplerRequest request, StaplerResponse respons private TapAttachment getAttachment(TestSet ts, String key) { for(TestResult tr : ts.getTestResults()){ Map diagnostics = tr.getDiagnostic(); - String parentKey = null; if(diagnostics != null && diagnostics.size() > 0) { - return recursivelySearch(diagnostics, parentKey, key); + TapAttachment attachement = recursivelySearch(diagnostics, null, key); + if (attachement != null) { + return attachement; + } } } return null; @@ -376,7 +378,10 @@ private TapAttachment recursivelySearch(Map diagnostics, String Object value = diagnostics.get(diagnosticKey); if(value != null) { if(value instanceof Map) { - return recursivelySearch((Map)value, diagnosticKey, key); + TapAttachment attachment = recursivelySearch((Map)value, diagnosticKey, key); + if (attachment != null) { + return attachment; + } } else { if(parentKey != null && parentKey.equals(key)) { Object o = diagnostics.get("File-Content");