Fixed null pointer introduced while implementing JENKINS-23533