In many Jenkinsfiles, the variable currentRelease only gets set at the very beginning, in the first stage/step of a pipeline. If a pipeline fails and needs to be restarted from a stage in the middle, currentRelease will be null. This needs to be addressed as it is very time-consuming to start a multi-hour pipeline from the beginning, because a minor step near the end failed. A better way to set currentRelease needs to be found so that any pipeline restarted with the "Restart From Stage..." functionality will work as expected.