Skip to content

Commit 48ed774

Browse files
authored
Add null check for log match group (#4522)
Signed-off-by: renfeiw <[email protected]>
1 parent d3dec9b commit 48ed774

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

buildenv/jenkins/JenkinsfileBase

+5-3
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,11 @@ def runTest( ) {
699699
def resultSum = [:]
700700
def matcher = manager.getLogMatcher(".*(TOTAL: \\d+)\\s*(EXECUTED: \\d+)\\s*(PASSED: \\d+)\\s*(FAILED: \\d+)\\s*(DISABLED: \\d+)?\\s*(SKIPPED: \\d+)\\s*\$")
701701
if (matcher?.matches()) {
702-
for (int i = 1; i < matcher.groupCount(); i++) {
703-
def matchVals = matcher.group(i).split(": ")
704-
resultSum[matchVals[0]] = matchVals[1] as int
702+
for (int i = 1; i <= matcher.groupCount(); i++) {
703+
if (matcher.group(i) != null) {
704+
def matchVals = matcher.group(i).split(": ")
705+
resultSum[matchVals[0]] = matchVals[1] as int
706+
}
705707
}
706708
checkTestResults(resultSum)
707709
} else {

0 commit comments

Comments
 (0)