Commit 7077d717 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #1464 from ipfs/fix/filters-offline

error out swarm filter when no daemon is online
parents d4656657 e8d825de
......@@ -392,6 +392,11 @@ Filters default to those specified under the "Swarm.AddrFilters" config key.
return
}
if n.PeerHost == nil {
res.SetError(errNotOnline, cmds.ErrNormal)
return
}
snet, ok := n.PeerHost.Network().(*swarm.Network)
if !ok {
res.SetError(errors.New("failed to cast network to swarm network"), cmds.ErrNormal)
......@@ -434,6 +439,11 @@ add your filters to the ipfs config file.
return
}
if n.PeerHost == nil {
res.SetError(errNotOnline, cmds.ErrNormal)
return
}
snet, ok := n.PeerHost.Network().(*swarm.Network)
if !ok {
res.SetError(errors.New("failed to cast network to swarm network"), cmds.ErrNormal)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment