mirror of
https://github.com/MaxiFan/TunnelX.git
synced 2026-05-17 21:14:37 +03:00
Clean nullable warnings in traffic router
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user