提交 20b64991 作者: Yuval Langer

Move no arguments check to before opening fsrepo.

License: MIT
Signed-off-by: 's avatarYuval Langer <yuval.langer@gmail.com>
上级 42468d0e
...@@ -461,6 +461,11 @@ add your filters to the ipfs config file. ...@@ -461,6 +461,11 @@ add your filters to the ipfs config file.
return return
} }
if len(req.Arguments()) == 0 {
res.SetError(errors.New("no filters to add"), cmds.ErrClient)
return
}
r, err := fsrepo.Open(req.InvocContext().ConfigRoot) r, err := fsrepo.Open(req.InvocContext().ConfigRoot)
if err != nil { if err != nil {
res.SetError(err, cmds.ErrNormal) res.SetError(err, cmds.ErrNormal)
...@@ -473,11 +478,6 @@ add your filters to the ipfs config file. ...@@ -473,11 +478,6 @@ add your filters to the ipfs config file.
return return
} }
if len(req.Arguments()) == 0 {
res.SetError(errors.New("no filters to add"), cmds.ErrClient)
return
}
for _, arg := range req.Arguments() { for _, arg := range req.Arguments() {
mask, err := mafilter.NewMask(arg) mask, err := mafilter.NewMask(arg)
if err != nil { if err != nil {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论