diff --git a/src/LibChorus/Utilities/HgProcessOutputReader.cs b/src/LibChorus/Utilities/HgProcessOutputReader.cs index ebc3fca8..5e6974eb 100644 --- a/src/LibChorus/Utilities/HgProcessOutputReader.cs +++ b/src/LibChorus/Utilities/HgProcessOutputReader.cs @@ -69,7 +69,7 @@ public bool Read(ref Process process, int secondsBeforeTimeOut, IProgress progre } //nb: at one point I (jh) tried adding !process.HasExited, but that made things less stable. - while ( _outputReader.ThreadState != ThreadState.Stopped && _errorReader.ThreadState != ThreadState.Stopped) + while (outputReaderArgs.Results == null || errorReaderArgs.Results == null) { DateTime end; lock (this) diff --git a/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs b/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs index ddaffd6f..3e546945 100644 --- a/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs +++ b/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs @@ -468,13 +468,13 @@ private string GetTextFromQuery(string query, int secondsBeforeTimeoutOnLocalOpe { var result = ExecuteErrorsOk(query, secondsBeforeTimeoutOnLocalOperation); - var standardOutputText = result.StandardOutput.Trim(); + var standardOutputText = result.StandardOutput?.Trim(); if (!string.IsNullOrEmpty(standardOutputText)) { _progress.WriteVerbose(standardOutputText); } - var standardErrorText = result.StandardError.Trim(); + var standardErrorText = result.StandardError?.Trim(); if (!string.IsNullOrEmpty(standardErrorText)) { _progress.WriteError(standardErrorText); @@ -485,7 +485,7 @@ private string GetTextFromQuery(string query, int secondsBeforeTimeoutOnLocalOpe _progress.WriteWarning("Hg Command {0} left lock", query); } - return result.StandardOutput; + return result.StandardOutput ?? ""; } ///