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() + } + }() }