Skip to content

Commit

Permalink
[JENKINS-41876] Check if global package value is blank instead null w…
Browse files Browse the repository at this point in the history
…hy after persistence migration value could not be null if in previous 0.2.x version value was spaces. XStream during de-serialisation does not instantiate object by its constructor, this means npmPackages value will empty (instead null) till a save is performed in configuration page.
  • Loading branch information
nfalco79 committed Feb 11, 2017
1 parent 5993ea7 commit e092acd
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -37,6 +37,7 @@

import javax.annotation.Nonnull;

import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;

import com.google.common.base.Predicate;
Expand Down Expand Up @@ -126,7 +127,7 @@ public FilePath performInstallation(ToolInstallation tool, Node node, TaskListen
}

// Installing npm packages if needed
if (this.npmPackages != null) {
if (StringUtils.isNotBlank(this.npmPackages)) { // JENKINS-41876
boolean skipNpmPackageInstallation = areNpmPackagesUpToDate(expected, this.npmPackages, this.npmPackagesRefreshHours);
if (!skipNpmPackageInstallation) {
expected.child(NPM_PACKAGES_RECORD_FILENAME).delete();
Expand Down

0 comments on commit e092acd

Please sign in to comment.