prevent null pointer JENKINS-19086

This fixes JENKINS-19086 issue. https://issues.jenkins-ci.org/browse/JENKINS-19086