fix TestCorefile1 panic for nil handling (#6802)

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
This commit is contained in:
Paco Xu 2024-08-05 18:47:04 +08:00 committed by GitHub
parent a6338e924e
commit ae65f4e0c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,5 +16,9 @@ func TestCorefile1(t *testing.T) {
acl acl
` `
i, _, _, _ := CoreDNSServerAndPorts(corefile) i, _, _, _ := CoreDNSServerAndPorts(corefile)
defer i.Stop() defer func() {
if i != nil {
i.Stop()
}
}()
} }