#6767 fix the crash when given language is not supported

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34656 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-06-14 19:33:43 +00:00
parent 88fa080978
commit 94c113d24f

View File

@ -217,10 +217,14 @@ AspellSpeller * AspellChecker::Private::addSpeller(string const & lang,
if (aspell_error_number(m.e_speller) != 0) {
// FIXME: We should indicate somehow that this language is not supported.
LYXERR(Debug::FILES, "aspell error: " << aspell_error_message(m.e_speller));
delete_aspell_can_have_error(m.e_speller);
delete_aspell_config(m.config);
m.config = 0;
m.e_speller = 0;
}
spellers_[spellerID(lang, variety)] = m;
return to_aspell_speller(m.e_speller);
return 0 == m.config ? 0 : to_aspell_speller(m.e_speller);
}