Skip to content

Commit

Permalink
default initialization for ignore columns (dotnet#302)
Browse files Browse the repository at this point in the history
* default initialization

* adde null check
  • Loading branch information
srsaggam authored Mar 20, 2019
1 parent 30046a1 commit d2c50a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mlnet/Commands/CommandDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal static System.CommandLine.Command New(ICommandHandler handler)
{
return "The following options are mutually exclusive please provide only one : --label-column-name, --label-column-index";
}
if (sym.Children.Contains("--label-column-index") && sym.Children["--ignore-columns"].Arguments.Count > 0)
if (sym.Children.Contains("--label-column-index") && sym.Children["--ignore-columns"]?.Arguments.Count > 0)
{
return "Currently we don't support specifying --ignore-columns in conjunction with --label-column-index";
}
Expand Down
2 changes: 1 addition & 1 deletion src/mlnet/Commands/New/NewCommandSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class NewCommandSettings

public string Cache { get; set; }

public List<string> IgnoreColumns { get; set; }
public List<string> IgnoreColumns { get; set; } = new List<string>();

}
}

0 comments on commit d2c50a7

Please sign in to comment.