From 6ab9557061fc338ee33b62be4d7bbbbe27cebde0 Mon Sep 17 00:00:00 2001 From: Waldemar Zurowski Date: Wed, 16 Sep 2020 09:52:41 +0200 Subject: [PATCH] Use safe navigation operator for correct field when checking the time of previous build. Handles an edge case when there is the very first build for the branch --- .ci/dev/regression/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 388d64360c..b805ff0fd8 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -248,7 +248,7 @@ pipeline { // Comparing the dates of the previous and current builds achieves this, // i.e. we will only send an email for the first build on a given day. def prevBuildDate = new Date( - currentBuild?.previousBuild.timeInMillis ?: 0).clearTime() + currentBuild.previousBuild?.timeInMillis ?: 0).clearTime() def currentBuildDate = new Date( currentBuild.timeInMillis).clearTime()