From 3f19958c75566493b61234a948b3e0770ac71cbc Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:50:24 +0800 Subject: [PATCH] Bug fix https://github.com/2dust/v2rayN/issues/7179 --- v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs index 8f684782..e3f053fb 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs @@ -174,6 +174,11 @@ public class ClashProxiesViewModel : MyReactiveObject public void RefreshProxyGroups() { + if (_proxies == null) + { + return; + } + var selectedName = SelectedGroup?.Name; _proxyGroups.Clear(); @@ -229,7 +234,7 @@ public class ClashProxiesViewModel : MyReactiveObject else { SelectedGroup = _proxyGroups.First(); - } + } } else { @@ -297,8 +302,10 @@ public class ClashProxiesViewModel : MyReactiveObject private ProxiesItem? TryGetProxy(string name) { - if (_proxies is null) + if (_proxies == null) + { return null; + } _proxies.TryGetValue(name, out var proxy2); if (proxy2 != null) {