[FIXES JENKINS-20932] Avoid NPE by checking the getLastSuccessfulBuild()...

... for null before calling resolveProject()