From fba84c82978efcacee91cffbbc455aba331e8e9b Mon Sep 17 00:00:00 2001 From: Chiahong <36815907+ChiahongHong@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:00:17 +0800 Subject: [PATCH] fix: prevent crash in Custom Action when executable path is missing (#646) --- src/Commands/ExecuteCustomAction.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index 0573aed9..253c6b43 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -45,6 +45,9 @@ namespace SourceGit.Commands try { proc.Start(); + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + proc.WaitForExit(); } catch (Exception e) { @@ -54,9 +57,6 @@ namespace SourceGit.Commands }); } - proc.BeginOutputReadLine(); - proc.BeginErrorReadLine(); - proc.WaitForExit(); proc.Close(); } }