Fix Process.CancelErrorRead
[mono.git] / mcs / class / System / System.Diagnostics / Process.cs
index e08d79e0f10b97df5d49e13bbc1075a36df682a4..515903d3fe01c610e607cc0d12e3fab7167d6d8b 100644 (file)
@@ -1517,8 +1517,8 @@ namespace System.Diagnostics {
                [ComVisibleAttribute(false)] 
                public void CancelErrorRead ()
                {
-                       if (process_handle == IntPtr.Zero || output_stream == null || StartInfo.RedirectStandardOutput == false)
-                               throw new InvalidOperationException ("Standard output has not been redirected or process has not been started.");
+                       if (process_handle == IntPtr.Zero || error_stream == null || StartInfo.RedirectStandardError == false)
+                               throw new InvalidOperationException ("Standard error has not been redirected or process has not been started.");
 
                        if ((async_mode & AsyncModes.SyncOutput) != 0)
                                throw new InvalidOperationException ("OutputStream is not enabled for asynchronous read operations.");