Skip to content

Commit

Permalink
[FIX JENKINS-27496] reconfigure may return null
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Mar 18, 2015
1 parent c415857 commit e5e3143
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -88,7 +88,7 @@ private EnvInjectJobPropertyContributor[] computeEnvInjectContributors() throws
EnvInjectJobPropertyContributor[] contributorsInstance = envInjectContributorManagement.getNewContributorsInstance();

//No jobProperty Contributors ==> new configuration
if (contributors == null || contributors.length == 0) {
if (contributors == null || contributors.lerength == 0) {
return contributorsInstance;
}

Expand Down Expand Up @@ -132,7 +132,7 @@ public void setContributors(EnvInjectJobPropertyContributor[] jobPropertyContrib
@Override
public JobProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException {
EnvInjectJobProperty property = (EnvInjectJobProperty) super.reconfigure(req, form);
if (property.info != null && !Jenkins.getInstance().hasPermission(Jenkins.RUN_SCRIPTS)) {
if (property != null && property.info != null && !Jenkins.getInstance().hasPermission(Jenkins.RUN_SCRIPTS)) {
// Don't let non RUN_SCRIPT users set arbitrary groovy script
property.info = new EnvInjectJobPropertyInfo(property.info.propertiesFilePath, property.info.propertiesContent,
property.info.getScriptFilePath(), property.info.getScriptContent(),
Expand Down

0 comments on commit e5e3143

Please sign in to comment.