From 247c59c563dfd0437acbccb0863d55d01832ec49 Mon Sep 17 00:00:00 2001 From: MaxFan Date: Mon, 11 May 2026 21:25:14 +0330 Subject: [PATCH] Clean nullable warnings in traffic router --- AppTunnel/Services/TrafficRouterService.FlowTracking.cs | 2 +- AppTunnel/Services/TrafficRouterService.LegacyRouting.cs | 2 +- .../Services/TrafficRouterService.PacketIntercept.cs | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AppTunnel/Services/TrafficRouterService.FlowTracking.cs b/AppTunnel/Services/TrafficRouterService.FlowTracking.cs index 483c2a0..7ad070e 100644 --- a/AppTunnel/Services/TrafficRouterService.FlowTracking.cs +++ b/AppTunnel/Services/TrafficRouterService.FlowTracking.cs @@ -121,7 +121,7 @@ public partial class TrafficRouterService for (int hop = 0; hop < 8 && current > 4; hop++) { var name = GetProcessNameByPid(current); - if (IsExecutableTargeted(name)) + if (!string.IsNullOrWhiteSpace(name) && IsExecutableTargeted(name)) { _pidTargetOwnerCache[pid] = name; return name; diff --git a/AppTunnel/Services/TrafficRouterService.LegacyRouting.cs b/AppTunnel/Services/TrafficRouterService.LegacyRouting.cs index 9b97015..31f3bf6 100644 --- a/AppTunnel/Services/TrafficRouterService.LegacyRouting.cs +++ b/AppTunnel/Services/TrafficRouterService.LegacyRouting.cs @@ -75,7 +75,7 @@ public partial class TrafficRouterService if (TryParseConnectionTuple(buffer, readLen, out var tuple)) { var processName = connectionCache.GetProcessName(tuple); - if (IsExecutableTargeted(processName)) + if (!string.IsNullOrWhiteSpace(processName) && IsExecutableTargeted(processName)) { shouldRedirect = true; matchedProcess = processName; diff --git a/AppTunnel/Services/TrafficRouterService.PacketIntercept.cs b/AppTunnel/Services/TrafficRouterService.PacketIntercept.cs index 1066a97..72a8548 100644 --- a/AppTunnel/Services/TrafficRouterService.PacketIntercept.cs +++ b/AppTunnel/Services/TrafficRouterService.PacketIntercept.cs @@ -99,7 +99,9 @@ public partial class TrafficRouterService } isBlockedProc = !_fullRouteEnabled && IsExecutableBlocked(packetProc); - if (!shouldRoute && !isBlockedProc && IsExecutableTargeted(packetProc)) + if (!shouldRoute && !isBlockedProc && + !string.IsNullOrWhiteSpace(packetProc) && + IsExecutableTargeted(packetProc)) { shouldRoute = true; _ipToProcess[dstNbo] = packetProc; @@ -202,7 +204,7 @@ public partial class TrafficRouterService dnsProc = connCache.GetProcessName(tuple2); } - if (IsExecutableTargeted(dnsProc)) + if (!string.IsNullOrWhiteSpace(dnsProc) && IsExecutableTargeted(dnsProc)) { uint publicDnsNbo = _dnsRedirectIpNbo; @@ -275,7 +277,7 @@ public partial class TrafficRouterService } // Check if source app is in target tunnel apps - if (IsExecutableTargeted(procName)) + if (!string.IsNullOrWhiteSpace(procName) && IsExecutableTargeted(procName)) { shouldRoute = true; }