Ensure that the agent aborts if the console window is NULL

It should guard against a recurrence of
https://youtrack.jetbrains.com/issue/IDEA-156228.
This commit is contained in:
Ryan Prichard 2016-05-24 16:33:23 -05:00
parent 21eaf31141
commit 3f42e83207

View File

@ -128,6 +128,13 @@ Agent::Agent(LPCWSTR controlPipeName,
{
trace("Agent::Agent entered");
// The console window must be non-NULL. It is used for two purposes:
// (1) "Freezing" the console to detect the exact number of lines that
// have scrolled.
// (2) Killing processes attached to the console, by posting a WM_CLOSE
// message to the console window.
ASSERT(GetConsoleWindow() != nullptr);
m_bufferData.resize(BUFFER_LINE_COUNT);
m_console = new Win32Console;