Fix(dns): set handler when resolver not nil

This commit is contained in:
Dreamacro 2019-07-15 10:18:42 +08:00
parent c1b5e4f561
commit 0dd2a6dee5

View file

@ -32,7 +32,7 @@ func (s *Server) setHandler(handler handler) {
} }
func ReCreateServer(addr string, resolver *Resolver) error { func ReCreateServer(addr string, resolver *Resolver) error {
if addr == address { if addr == address && resolver != nil {
handler := newHandler(resolver) handler := newHandler(resolver)
server.setHandler(handler) server.setHandler(handler)
return nil return nil