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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user