fix fakedns is nil

This commit is contained in:
pocketW authored and yuhan6665 committed 2022-04-30 11:21:23 -04:00
1 parent 244db57398
commit dcba88e511
1 file changed
+1 -1
+1 -1
View File
@@ -15,7 +15,7 @@ import (
func newFakeDNSSniffer(ctx context.Context) (protocolSnifferWithMetadata, error) { func newFakeDNSSniffer(ctx context.Context) (protocolSnifferWithMetadata, error) {
var fakeDNSEngine dns.FakeDNSEngine var fakeDNSEngine dns.FakeDNSEngine
{ {
fakeDNSEngineFeat := core.MustFromContext(ctx).GetFeature(fakeDNSEngine) fakeDNSEngineFeat := core.MustFromContext(ctx).GetFeature((*dns.FakeDNSEngine)(nil))
if fakeDNSEngineFeat != nil { if fakeDNSEngineFeat != nil {
fakeDNSEngine = fakeDNSEngineFeat.(dns.FakeDNSEngine) fakeDNSEngine = fakeDNSEngineFeat.(dns.FakeDNSEngine)
} }