Fix crash.

This commit is contained in:
Lymia Aluysia
2017-01-18 06:25:22 -06:00
parent e0213877e4
commit 8f7cc53d5b
+1 -1
View File
@@ -96,7 +96,7 @@ bool SpellChecker::convert_encoding(const String& word, CharBuffer& out) {
} }
// convert encoding // convert encoding
out = fixed.mb_str(encoding); out = fixed.mb_str(encoding);
if (*out == '\0') { if (!out || *out == '\0') {
// If encoding fails we get an empty string, since the word was not empty this can never happen // If encoding fails we get an empty string, since the word was not empty this can never happen
// words that can't be encoded are not in the dictionary, so they are wrong. // words that can't be encoded are not in the dictionary, so they are wrong.
return false; return false;