[JENKINS-17248] Robustness against NPE

See [JENKINS-17248](https://issues.jenkins-ci.org/browse/JENKINS-17248) for background. This patch should at least make the error not prevent Jenkins startup.