It really doesn't matter, even though it's wrong. But go ahead and fix it if you want

The
HasInputStream branch won't be taken, since the stream is already closed. Only the error stream cannot be closed programmatically which is why it must be drained, else the program might hang if you kill a process that has more data in the error stream than will fit in the buffer. However, killing doesn't work under Windows anyway, and under Linux, the buffer size should not be a problem.