jenkinsci/build-user-vars-plugin — pull request #4 by oleg-nenashev (2014-05-13 09:05:16+00:00)
Title: [FIXED JENKINS-22974] - NPE in makeUserVars if an upstream build is missing

The PR contains the bugfix and the direct test case.
AFAIK, the newest Jenkins core versions contain annotations for Job::getBuildByNumber(), hence developers will be notified about such issues.