diff --git a/ChangeLog.md b/ChangeLog.md index 00f8b937a..60301df41 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -304,6 +304,7 @@ Nazara Development Kit: - Fixed PhysicsComponent2D copy not copying physics attributes - Added Entity::DropComponent which detaches a component without necessarily destroying it - ⚠ ConstraintComponent2D has been reworked to handle entity destruction and remove constraints at will +- Fixed crash when pressing up/down key with no history in the console # 0.4: diff --git a/SDK/src/NDK/Console.cpp b/SDK/src/NDK/Console.cpp index 67f3e69b2..20a004f25 100644 --- a/SDK/src/NDK/Console.cpp +++ b/SDK/src/NDK/Console.cpp @@ -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;