diff --git a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java index 692fcf7ac18367576ffa645bb248cd5977ebb1d4..735a31085183717c867df4d2455a145328e0d5f0 100644 --- a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java +++ b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java @@ -43,11 +43,14 @@ import java.util.List; * @since 1.286 */ public class ToolLocationNodeProperty extends NodeProperty { - + /** + * Override locations. Never null. + */ private final List locations; @DataBoundConstructor public ToolLocationNodeProperty(List locations) { + if(locations==null) throw new IllegalArgumentException(); this.locations = locations; } @@ -56,7 +59,6 @@ public class ToolLocationNodeProperty extends NodeProperty { } public List getLocations() { - if (locations == null) return Collections.emptyList(); return Collections.unmodifiableList(locations); }