This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch parallel
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/parallel by this push:
new b5bcd54 last() cannot be called on []
b5bcd54 is described below
commit b5bcd54bfb9ebbfebcf8bbb92765c448c93fa0b3
Author: tibordigana <[email protected]>
AuthorDate: Fri Aug 2 21:43:37 2019 +0200
last() cannot be called on []
---
Jenkinsfile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 40ca31c..c4ba3a4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -112,10 +112,10 @@ timeout(time: 12, unit: 'HOURS') {
currentBuild.result = 'FAILURE'
throw e
} finally {
- def isFirstBuild = currentBuild == null || currentBuild.changeSets ==
null
- def authors = isFirstBuild ? [] :
currentBuild.changeSets.last().toList().collect { it.author.toString()
}.unique()
+ def changes = currentBuild?.changeSets
+ def authors = !changes || changes.isEmpty() ? [] :
changes.last().toList().collect { it.author.toString() }.unique()
println("The author of the last change: ${authors}")
- if (isFirstBuild || !authors.contains('github')) jenkinsNotify()
+ if (!changes || !authors.contains('github')) jenkinsNotify()
}
}