diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-23 16:55:27 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-08-24 12:12:07 +0200 |
commit | 33d589cde771df5f8b2916cf248cfc341286b559 (patch) | |
tree | e0d280df8aee8b27a2f82529a7601f47c5b9bac7 /sw | |
parent | e9fd6d94c3fe58ad6319daba5afca644e4e699a7 (diff) |
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/+/120878
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index f8773b4d9938..44b1cc3caa2a 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1518,7 +1518,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, |