From 5ea3340d3275749a616e0df3759a9f56214fa3fb Mon Sep 17 00:00:00 2001 From: Trivalik Date: Fri, 4 Jun 2021 13:00:39 +0200 Subject: [PATCH] add null check, that on pipeline fail with defect script no exception appear --- .../main/java/hudson/plugins/tfs/TeamFoundationServerScm.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tfs/src/main/java/hudson/plugins/tfs/TeamFoundationServerScm.java b/tfs/src/main/java/hudson/plugins/tfs/TeamFoundationServerScm.java index 86f684668..4600c7ad1 100644 --- a/tfs/src/main/java/hudson/plugins/tfs/TeamFoundationServerScm.java +++ b/tfs/src/main/java/hudson/plugins/tfs/TeamFoundationServerScm.java @@ -534,6 +534,10 @@ public void buildEnvVars(final AbstractBuild build, final Map build, final Map env) { + // catch null on pipeline fail + if(null == build) { + return; + } final TeamBuildDetailsAction buildDetailsAction = build.getAction(TeamBuildDetailsAction.class); if (buildDetailsAction != null) { //Add the TFS build variables as environment variables in the Jenkins environment