From 01dd1ff56f0b055bb76a574105c2d18c1e3cc766 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 21 May 2023 14:43:07 +0800 Subject: [PATCH] Fix cannot insert routing rule with only process name --- .../v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/v2rayN/v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs b/v2rayN/v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs index a21486aa..d1f7abf8 100644 --- a/v2rayN/v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs @@ -87,13 +87,10 @@ namespace v2rayN.ViewModels SelectedSource.protocol = ProtocolItems?.ToList(); SelectedSource.inboundTag = InboundTagItems?.ToList(); - bool hasRule = - SelectedSource.domain != null - && SelectedSource.domain.Count > 0 - || SelectedSource.ip != null - && SelectedSource.ip.Count > 0 - || SelectedSource.protocol != null - && SelectedSource.protocol.Count > 0 + bool hasRule = SelectedSource.domain?.Count > 0 + || SelectedSource.ip?.Count > 0 + || SelectedSource.protocol?.Count > 0 + || SelectedSource.process?.Count > 0 || !Utils.IsNullOrEmpty(SelectedSource.port); if (!hasRule)