From 1c89394aef6abb1e4810c84db01d44cec770dee7 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Tue, 26 Apr 2022 15:21:45 +0300 Subject: [PATCH] Pull request: 4525 fix panic Merge in DNS/adguard-home from 3020-fix-panic to master Closes #4525. Squashed commit of the following: commit f8d9e25eccb485269aa2f0275d4e08da767f9d05 Author: Eugene Burkov Date: Tue Apr 26 15:09:11 2022 +0300 home: imp code commit 8fe02c8f057c05b9e8ce1de056a92e7cd69ae4c6 Author: Eugene Burkov Date: Tue Apr 26 14:44:33 2022 +0300 home: fix panic --- internal/home/dns.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/home/dns.go b/internal/home/dns.go index e0fc1aab..e28193ee 100644 --- a/internal/home/dns.go +++ b/internal/home/dns.go @@ -135,9 +135,11 @@ func initDNSServer() (err error) { return fmt.Errorf("dnsServer.Prepare: %w", err) } - Context.rdns = NewRDNS(Context.dnsServer, &Context.clients, config.DNS.UsePrivateRDNS) + if config.Clients.Sources.RDNS { + Context.rdns = NewRDNS(Context.dnsServer, &Context.clients, config.DNS.UsePrivateRDNS) + } - if !config.Clients.Sources.WHOIS { + if config.Clients.Sources.WHOIS { Context.whois = initWHOIS(&Context.clients) }