net/dns: check if Manager.knobs isn't nil before using it

Updates corp#15802

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina 2024-06-07 15:35:43 +01:00
parent 0219317372
commit 8e1d46e54f

View File

@ -296,6 +296,9 @@ func (m *Manager) compileConfig(cfg Config) (rcfg resolver.Config, ocfg OSConfig
}
func (m *Manager) disableSplitDNSOptimization() bool {
if m.knobs == nil {
return false
}
return m.knobs.DisableSplitDNSWhenNoCustomResolvers.Load()
}