sw/source/uibase/shells/textsh1.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 6d2d104cebbf061c2ebdb533d29c4885c0b72868 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Aug 23 16:55:27 2021 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Sep 1 10:23:05 2021 +0200 rhbz#1996735 SwEditShell::GetCorrection can return null Though the exact steps to reproduce are unknown. From the text seen in the backtrace the language is possibly Finnish in which case voikko is probably the spellchecking backend in use. Change-Id: I9b3186e4699946235ccc161575bba7d4a3820565 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120879 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins (cherry picked from commit 16186a8bed2d241b1dd5711637b9d4c07ca0e1e4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120888 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> Reviewed-by: Xisco Fauli <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Miklos Vajna <[email protected]> diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 7ebde86a383c..416982ada3a9 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1500,7 +1500,9 @@ void SwTextShell::Execute(SfxRequest &rReq) else if (sApplyText == "Spelling") { SwRect aToFill; - uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) ); + uno::Reference<linguistic2::XSpellAlternatives> xSpellAlt(rWrtSh.GetCorrection(nullptr, aToFill)); + if (!xSpellAlt.is()) + return; uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList(); OUString sWord(xSpellAlt->getWord()); linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( xDictionary,
