adding a null check to try to prevent an NPE. hopefully resolving
[JENKINS-24839]