NDK/Console: Fix crash on empty history

This commit is contained in:
Lynix
2019-12-15 11:50:02 +01:00
parent 7e6dcdf740
commit 437f60dbd4
2 changed files with 7 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ namespace Ndk
{
*ignoreDefaultAction = true;
if (m_commandHistory.empty())
return;
if (m_historyPosition > 0)
m_historyPosition--;
@@ -91,6 +94,9 @@ namespace Ndk
{
*ignoreDefaultAction = true;
if (m_commandHistory.empty())
return;
if (++m_historyPosition >= m_commandHistory.size())
m_historyPosition = 0;