From d51f7f44484ceaf7def3302319f2c8522f6c6adc Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 14 Jun 2019 11:32:47 +0800 Subject: [PATCH] Avoid substr exception when using on-screen keyboard --- src/guiengine/widgets/CGUIEditBox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/guiengine/widgets/CGUIEditBox.cpp b/src/guiengine/widgets/CGUIEditBox.cpp index f036b55a9..cb0cf81af 100644 --- a/src/guiengine/widgets/CGUIEditBox.cpp +++ b/src/guiengine/widgets/CGUIEditBox.cpp @@ -1386,8 +1386,11 @@ void CGUIEditBox::calculateScrollPos() void CGUIEditBox::setTextMarkers(s32 begin, s32 end) { if (GUIEngine::ScreenKeyboard::isActive()) + { + m_mark_begin = m_mark_end = 0; return; - + } + if (begin != m_mark_begin || end != m_mark_end) { m_mark_begin = begin;