Skip to content

Commit a6420af

Browse files
committed
fix: crash if the executable file can not be found
1 parent addc756 commit a6420af

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Commands/ExecuteCustomAction.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ public static void Run(string repo, string file, string args, Action<string> out
5353
proc.BeginOutputReadLine();
5454
proc.BeginErrorReadLine();
5555
proc.WaitForExit();
56+
57+
var exitCode = proc.ExitCode;
58+
if (exitCode != 0)
59+
{
60+
var errMsg = builder.ToString();
61+
Dispatcher.UIThread.Invoke(() =>
62+
{
63+
App.RaiseException(repo, errMsg);
64+
});
65+
}
5666
}
5767
catch (Exception e)
5868
{
@@ -62,17 +72,7 @@ public static void Run(string repo, string file, string args, Action<string> out
6272
});
6373
}
6474

65-
var exitCode = proc.ExitCode;
6675
proc.Close();
67-
68-
if (exitCode != 0)
69-
{
70-
var errMsg = builder.ToString();
71-
Dispatcher.UIThread.Invoke(() =>
72-
{
73-
App.RaiseException(repo, errMsg);
74-
});
75-
}
7676
}
7777
}
7878
}

0 commit comments

Comments
 (0)