From 679f599c791be4d658d0e44174055b0424eb832c Mon Sep 17 00:00:00 2001 From: Lynix Date: Mon, 16 Jan 2017 21:25:23 +0100 Subject: [PATCH] Sdk/Console: Fix crash --- SDK/src/NDK/Console.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SDK/src/NDK/Console.cpp b/SDK/src/NDK/Console.cpp index 82d3d40af..1e49ec25f 100644 --- a/SDK/src/NDK/Console.cpp +++ b/SDK/src/NDK/Console.cpp @@ -192,9 +192,12 @@ namespace Ndk m_historyPosition = 1; } - Nz::String text = m_commandHistory[m_commandHistory.size() - m_historyPosition]; - m_inputDrawer.SetText(s_inputPrefix + text); - m_inputTextSprite->Update(m_inputDrawer); + if (!m_commandHistory.empty()) + { + Nz::String text = m_commandHistory[m_commandHistory.size() - m_historyPosition]; + m_inputDrawer.SetText(s_inputPrefix + text); + m_inputTextSprite->Update(m_inputDrawer); + } break; }