From 7fc9c32444ea9e68996d1940bbefd3ebdc042fc4 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Fri, 27 Feb 2026 15:36:57 +0800 Subject: [PATCH] Fix --- .../Handler/Builder/CoreConfigContextBuilder.cs | 2 +- .../ServiceLib/Handler/Builder/NodeValidator.cs | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs index a4585d2c..f58e066c 100644 --- a/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs +++ b/v2rayN/ServiceLib/Handler/Builder/CoreConfigContextBuilder.cs @@ -40,7 +40,7 @@ public class CoreConfigContextBuilder validatorResult.Warnings.AddRange(nodeValidatorResult.Warnings); if (!(context.RoutingItem?.RuleSet.IsNullOrEmpty() ?? true)) { - var rules = JsonUtils.Deserialize>(context.RoutingItem?.RuleSet); + var rules = JsonUtils.Deserialize>(context.RoutingItem?.RuleSet) ?? []; foreach (var ruleItem in rules.Where(ruleItem => !Global.OutboundTags.Contains(ruleItem.OutboundTag))) { if (ruleItem.OutboundTag.IsNullOrEmpty()) diff --git a/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs b/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs index ea4876c6..a6adf1c2 100644 --- a/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs +++ b/v2rayN/ServiceLib/Handler/Builder/NodeValidator.cs @@ -106,16 +106,11 @@ public class NodeValidator break; case EConfigType.VLESS: - // Example of converting a non-critical issue to Warning if desired - if (item.Password.Length <= 30 && !Utils.IsGuidByParse(item.Password)) - { - v.Assert(!item.Password.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, "Password")); - } - else - { - v.Assert(!item.Password.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, "Password")); - } - + v.Assert( + !item.Password.IsNullOrEmpty() + && (Utils.IsGuidByParse(item.Password) || item.Password.Length <= 30), + string.Format(ResUI.MsgInvalidProperty, "Password") + ); v.Assert(Global.Flows.Contains(protocolExtra.Flow ?? string.Empty), string.Format(ResUI.MsgInvalidProperty, "Flow")); break;