Fix a crash of the debug console

This fixes a crash when pyrogenesis got compiled with certain
compilers, whenever a command is entered in the console, while no
console.txt log exists.

Fixes #7964
This commit is contained in:
Dunedan 2025-05-22 18:08:29 +02:00
parent 72be06fd7f
commit 1985fefcbd
No known key found for this signature in database
GPG key ID: 885B16854284E0B2

View file

@ -578,7 +578,7 @@ void CConsole::ProcessBuffer(const wchar_t* szLine)
ENSURE(wcslen(szLine) < CONSOLE_BUFFER_SIZE);
if (!m_HistoryIgnoreDuplicates || m_BufHistory.front() != szLine)
if (!m_HistoryIgnoreDuplicates || m_BufHistory.empty() || m_BufHistory.front() != szLine)
{
m_BufHistory.push_front(szLine);
SaveHistory(); // Do this each line for the moment; if a script causes