JENKINS-23589 Added null check