aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-07-31 20:08:11 +0200
committerEugene Sandulenko2017-08-01 10:42:22 +0200
commitda9e02cebb8027a38ef10f3c990ae0ae816e0228 (patch)
treed373c35badb564b071d63aa76bf1d580e1a692ef
parent5149226255279c8e417a3bb9d1a473530c423117 (diff)
downloadscummvm-rg350-da9e02cebb8027a38ef10f3c990ae0ae816e0228.tar.gz
scummvm-rg350-da9e02cebb8027a38ef10f3c990ae0ae816e0228.tar.bz2
scummvm-rg350-da9e02cebb8027a38ef10f3c990ae0ae816e0228.zip
GRAPHICS: MACGUI: Fix crash on backspace in MacTextWindow input
-rw-r--r--graphics/macgui/mactextwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index d7c97c033b..9f8a2e2028 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -179,7 +179,7 @@ void MacTextWindow::drawInput() {
// And add new input line to the text
appendText(_inputText, _font);
- _cursorX = _fontRef->getStringWidth(text[_inputTextHeight - 1]);
+ _cursorX = _inputText.empty() ? 0 : _fontRef->getStringWidth(text[_inputTextHeight - 1]);
updateCursorPos();
}