-
Improvement
-
Resolution: Fixed
-
Minor
-
None
If you have an existing pipeline job and then change the workspace names in the Jenkinsfile, the build exits with:
[Pipeline] End of Pipeline
java.lang.NullPointerException
at org.jenkinsci.plugins.p4.tagging.TagAction.getLastChange(TagAction.java:201)
at org.jenkinsci.plugins.p4.PerforceScm.calculateChanges(PerforceScm.java:471)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:429)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
...cut...
Finished: FAILURE
From:
public static P4Revision getLastChange(Run<?, ?> run, TaskListener listener, String client) { P4Revision last = null; List<TagAction> actions = lastActions(run, listener); if (actions == null || client == null || client.isEmpty()) { return last; } // look for action matching view for (TagAction action : actions) { if (client.equals(action.getClient())) { last = action.getBuildChange(); } } listener.getLogger().println("Found last change " + last.toString() + " on client " + client); return last; }