Skip to content

Commit b7e4ff5

Browse files
committed
fix dnsList handle
1 parent 7b828ee commit b7e4ff5

File tree

1 file changed

+5
-1
lines changed
  • core/src/main/golang/native/app

1 file changed

+5
-1
lines changed

core/src/main/golang/native/app/dns.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import (
77
)
88

99
func NotifyDnsChanged(dnsList string) {
10-
dns.UpdateSystemDNS(strings.Split(dnsList, ","))
10+
var addr []string
11+
if len(dnsList) > 0 {
12+
addr = strings.Split(dnsList, ",")
13+
}
14+
dns.UpdateSystemDNS(addr)
1115
dns.FlushCacheWithDefaultResolver()
1216
}

0 commit comments

Comments
 (0)