aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2010-10-03 23:56:17 +0000
committerWillem Jan Palenstijn2010-10-03 23:56:17 +0000
commitd1fb1d5b2671f777e0e4ec7fceecfe6c4585858b (patch)
tree9d3ed2ba31ef6ed9e01f5be2f623e01f10474253 /engines/sci
parent27745c2143f5e79a0eb12d2b9aa19202d21637fb (diff)
downloadscummvm-rg350-d1fb1d5b2671f777e0e4ec7fceecfe6c4585858b.tar.gz
scummvm-rg350-d1fb1d5b2671f777e0e4ec7fceecfe6c4585858b.tar.bz2
scummvm-rg350-d1fb1d5b2671f777e0e4ec7fceecfe6c4585858b.zip
SCI: Fix AltInput crash in non-parser games
svn-id: r53008
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/controls.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp
index e4e7bc0c92..66376a793c 100644
--- a/engines/sci/graphics/controls.cpp
+++ b/engines/sci/graphics/controls.cpp
@@ -225,7 +225,7 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {
}
}
- if (!textChanged && oldCursorPos != cursorPos) {
+ if (g_sci->getVocabulary() && !textChanged && oldCursorPos != cursorPos) {
assert(!textAddChar);
textChanged = g_sci->getVocabulary()->checkAltInput(text, cursorPos);
}
@@ -257,7 +257,8 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {
// Note: the following checkAltInput call might make the text
// too wide to fit, but SSCI fails to check that too.
}
- g_sci->getVocabulary()->checkAltInput(text, cursorPos);
+ if (g_sci->getVocabulary())
+ g_sci->getVocabulary()->checkAltInput(text, cursorPos);
texteditCursorErase();
_paint16->eraseRect(rect);
_text16->Box(text.c_str(), 0, rect, SCI_TEXT16_ALIGNMENT_LEFT, -1);