Fix cannot insert routing rule with only process name

pull/3895/head
2dust 2023-05-21 14:43:07 +08:00
parent 9433213fe5
commit 01dd1ff56f
1 changed files with 4 additions and 7 deletions

View File

@ -87,13 +87,10 @@ namespace v2rayN.ViewModels
SelectedSource.protocol = ProtocolItems?.ToList(); SelectedSource.protocol = ProtocolItems?.ToList();
SelectedSource.inboundTag = InboundTagItems?.ToList(); SelectedSource.inboundTag = InboundTagItems?.ToList();
bool hasRule = bool hasRule = SelectedSource.domain?.Count > 0
SelectedSource.domain != null || SelectedSource.ip?.Count > 0
&& SelectedSource.domain.Count > 0 || SelectedSource.protocol?.Count > 0
|| SelectedSource.ip != null || SelectedSource.process?.Count > 0
&& SelectedSource.ip.Count > 0
|| SelectedSource.protocol != null
&& SelectedSource.protocol.Count > 0
|| !Utils.IsNullOrEmpty(SelectedSource.port); || !Utils.IsNullOrEmpty(SelectedSource.port);
if (!hasRule) if (!hasRule)