[JENKINS-17807] Fix NPE on building with certain other plugins installed

Fixes https://issues.jenkins-ci.org/browse/JENKINS-17807