From e986dc189eb80c0c60004af9216f798ed5e6b424 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:30:33 +0800 Subject: [PATCH] Fix ProcUtils NoAssociatedProcess issue --- v2rayN/ServiceLib/Common/ProcUtils.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v2rayN/ServiceLib/Common/ProcUtils.cs b/v2rayN/ServiceLib/Common/ProcUtils.cs index 0013b317..f9cc8ccd 100644 --- a/v2rayN/ServiceLib/Common/ProcUtils.cs +++ b/v2rayN/ServiceLib/Common/ProcUtils.cs @@ -24,18 +24,18 @@ public static class ProcUtils if (arguments.Contains(' ')) arguments = arguments.AppendQuotes(); - Process process = new() + Process proc = new() { StartInfo = new ProcessStartInfo { UseShellExecute = true, FileName = fileName, Arguments = arguments, - WorkingDirectory = dir + WorkingDirectory = dir ?? string.Empty } }; - process.Start(); - return process.Id; + proc.Start(); + return dir is null ? null : proc.Id; } catch (Exception ex) {