From b7e4ff551aaf7c1b281181a872da5a0db0f9f400 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sun, 6 Oct 2024 00:56:02 +0800 Subject: [PATCH] fix dnsList handle --- core/src/main/golang/native/app/dns.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/golang/native/app/dns.go b/core/src/main/golang/native/app/dns.go index 285ade09..d5af82a9 100644 --- a/core/src/main/golang/native/app/dns.go +++ b/core/src/main/golang/native/app/dns.go @@ -7,6 +7,10 @@ import ( ) func NotifyDnsChanged(dnsList string) { - dns.UpdateSystemDNS(strings.Split(dnsList, ",")) + var addr []string + if len(dnsList) > 0 { + addr = strings.Split(dnsList, ",") + } + dns.UpdateSystemDNS(addr) dns.FlushCacheWithDefaultResolver() }