You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/08/02 19:43:46 UTC

[maven-surefire] branch parallel updated: last() cannot be called on []

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 <ti...@apache.org>
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()
     }
 }