1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-01 16:05:47 +08:00

Move no arguments check to before opening fsrepo.

License: MIT
Signed-off-by: Yuval Langer <yuval.langer@gmail.com>
This commit is contained in:
Yuval Langer
2016-06-21 00:41:08 +03:00
parent 42468d0ebe
commit 20b6499102

View File

@ -461,6 +461,11 @@ add your filters to the ipfs config file.
return
}
if len(req.Arguments()) == 0 {
res.SetError(errors.New("no filters to add"), cmds.ErrClient)
return
}
r, err := fsrepo.Open(req.InvocContext().ConfigRoot)
if err != nil {
res.SetError(err, cmds.ErrNormal)
@ -473,11 +478,6 @@ add your filters to the ipfs config file.
return
}
if len(req.Arguments()) == 0 {
res.SetError(errors.New("no filters to add"), cmds.ErrClient)
return
}
for _, arg := range req.Arguments() {
mask, err := mafilter.NewMask(arg)
if err != nil {