From 35859a19f70d818aac7fe6dd061bd8563f8807d2 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sat, 10 Oct 2020 13:13:44 +0800 Subject: [PATCH] fix: #396 --- Netch/Utils/DNS.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Netch/Utils/DNS.cs b/Netch/Utils/DNS.cs index 5b06bc99..014637da 100644 --- a/Netch/Utils/DNS.cs +++ b/Netch/Utils/DNS.cs @@ -49,6 +49,8 @@ namespace Netch.Utils private static RegistryKey AdapterRegistry(bool write = false) { + if (Global.Outbound.Adapter == null) + Utils.SearchOutboundAdapter(); return Registry.LocalMachine.OpenSubKey( $@"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{Global.Outbound.Adapter.Id}", write); }