提交 068b7f7f 作者: Quantomic

Corrects mistake.

License: MIT
Signed-off-by: 's avatarMateja Milosevic <minima38123@gmail.com>
上级 c775a873
......@@ -122,15 +122,15 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
}
}
if f.FullPath() == "" {
return nil, fmt.Errorf("Corrupted data passed as file argument")
}
// if there is a required filearg, error if no files were provided
if len(requiredFile) > 0 && f == nil {
return nil, fmt.Errorf("File argument '%s' is required", requiredFile)
}
if f != nil && f.FullPath() == "" {
return nil, fmt.Errorf("Corrupted data passed as file argument")
}
req, err := cmds.NewRequest(pth, opts, args, f, cmd, optDefs)
if err != nil {
return nil, err
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论