Fixing NPE in Jenkins core caused by improper null return.
java.lang.NullPointerException
    hudson.model.Run.getDynamic(Run.java:2346)
traced back to this plugin:
def r = Jenkins.instance.getJob('…').getBuildByNumber(…);
println(r.getTransientActions());
for (factory in TransientBuildActionFactory.all()) {
  println(factory);
  println(factory.createFor((Run) r));
}