From ae65f4e0c7695a02c538424737505d4626d81a67 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Mon, 5 Aug 2024 18:47:04 +0800 Subject: [PATCH] fix TestCorefile1 panic for nil handling (#6802) Signed-off-by: Paco Xu --- test/corefile_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/corefile_test.go b/test/corefile_test.go index 789c6ef25..55ce83102 100644 --- a/test/corefile_test.go +++ b/test/corefile_test.go @@ -16,5 +16,9 @@ func TestCorefile1(t *testing.T) { acl ` i, _, _, _ := CoreDNSServerAndPorts(corefile) - defer i.Stop() + defer func() { + if i != nil { + i.Stop() + } + }() }