Merge pull request #10585 from caesarxuchao/fix-alias

Add boundary check before accessing os.Args[1]
This commit is contained in:
Eric Tune
2015-07-15 15:00:09 -07:00
6 changed files with 6 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ func NewCmdReplace(f *cmdutil.Factory, out io.Writer) *cobra.Command {
}
func RunReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, filenames util.StringList) error {
if os.Args[1] == "update" {
if len(os.Args) > 1 && os.Args[1] == "update" {
printDeprecationWarning("replace", "update")
}
schema, err := f.Validator()