GUI: Don't crash on empty dictionary in predictive dialog

This commit is contained in:
Torbjörn Andersson 2016-02-28 15:23:24 +01:00
parent bf5208dd3d
commit aded46f08b

View file

@ -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;