From ae4d4c876e44b36041423236f95bcfbece47b120 Mon Sep 17 00:00:00 2001 From: Chiahong Hong Date: Sun, 3 Nov 2024 15:14:18 +0800 Subject: [PATCH] fix: prevent crash in Custom Action when executable path is missing --- 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(); } }