Avoid NPE in getAdvancedCandidateRevisions when no build available

This fixes several null pointer exceptions in the plugin unit tests.
The new EnvVars() call seems flawed, but I could not find a better
solution.