fix: crash if the executable file can not be found

This commit is contained in:
leo 2024-12-31 09:38:32 +08:00
parent addc756fbf
commit a6420aff9b
No known key found for this signature in database

View file

@ -53,18 +53,8 @@ namespace SourceGit.Commands
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
proc.WaitForExit();
}
catch (Exception e)
{
Dispatcher.UIThread.Invoke(() =>
{
App.RaiseException(repo, e.Message);
});
}
var exitCode = proc.ExitCode;
proc.Close();
if (exitCode != 0)
{
var errMsg = builder.ToString();
@ -74,5 +64,15 @@ namespace SourceGit.Commands
});
}
}
catch (Exception e)
{
Dispatcher.UIThread.Invoke(() =>
{
App.RaiseException(repo, e.Message);
});
}
proc.Close();
}
}
}