Commit 3aef795c authored by Steven Allen's avatar Steven Allen

commands/p2p(fix): avoid creating empty multiaddrs

parent b892db89
......@@ -357,14 +357,22 @@ var p2pCloseCmd = &cmds.Command{
proto := protocol.ID(protoOpt)
listen, err := ma.NewMultiaddr(listenOpt)
if err != nil {
return err
var (
target, listen ma.Multiaddr
)
if l {
listen, err = ma.NewMultiaddr(listenOpt)
if err != nil {
return err
}
}
target, err := ma.NewMultiaddr(targetOpt)
if err != nil {
return err
if t {
target, err = ma.NewMultiaddr(targetOpt)
if err != nil {
return err
}
}
if !(closeAll || p || l || t) {
......
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