From 6286c11bed42c3e0d3bf4c1714f62aebf8bf62d5 Mon Sep 17 00:00:00 2001 From: mlmhl <409107750@qq.com> Date: Thu, 29 Jun 2017 09:49:55 +0800 Subject: [PATCH] Do not add nodes if dht is disabled --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index 635f96de..d1cf5069 100644 --- a/client.go +++ b/client.go @@ -1331,6 +1331,9 @@ func (cl *Client) DHT() *dht.Server { } func (cl *Client) AddDHTNodes(nodes []string) { + if cl.DHT() == nil { + return + } for _, n := range nodes { hmp := missinggo.SplitHostMaybePort(n) ip := net.ParseIP(hmp.Host) -- 2.48.1