-
Bug
-
Resolution: Unresolved
-
Minor
-
jenkins 2.107.1
envInject 1.5
When setting the checkbox "Envronment Variables" in global configuration without adding list of variables - `buildEnvironment` in `Computer` and many other actions starts throwing null pointer exception.
I think the problem is in here:
// Computer.java for (NodeProperty nodeProperty: Jenkins.getInstance().getGlobalNodeProperties()) { nodeProperty.buildEnvVars(env,listener); } // EnvironmentVariablesNodeProperty.java @Override public void buildEnvVars(EnvVars env, TaskListener listener) throws IOException, InterruptedException { env.putAll(envVars); }
getGlobalProperties returns NodeProperty with `envVars` that is null.
I think we should either remove the checkbox on save when no variable was added or think of a better UI for it.
Also in server side we should add protection against this issue as this completely blocked all my builds until I figured out what was the problem