aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2016-02-28 15:23:24 +0100
committerTorbjörn Andersson2016-02-28 15:23:24 +0100
commitaded46f08b476ee1caccc070b8495cafe7094b47 (patch)
treecaca2618d2c478f000dba626d42d408c2254a54a /gui
parentbf5208dd3df18e7ff05c4e18b3f03c00baf22238 (diff)
downloadscummvm-rg350-aded46f08b476ee1caccc070b8495cafe7094b47.tar.gz
scummvm-rg350-aded46f08b476ee1caccc070b8495cafe7094b47.tar.bz2
scummvm-rg350-aded46f08b476ee1caccc070b8495cafe7094b47.zip
GUI: Don't crash on empty dictionary in predictive dialog
Diffstat (limited to 'gui')
-rw-r--r--gui/predictivedialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index d9dd5734f8..9557da1206 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -724,6 +724,10 @@ int PredictiveDialog::binarySearch(const char *const *const dictLine, const Comm
}
bool PredictiveDialog::matchWord() {
+ // If there is no dictionary, then there is no match.
+ if (_unitedDict.dictLineCount <= 0)
+ return false;
+
// If no text has been entered, then there is no match.
if (_currentCode.empty())
return false;