diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-23 16:55:27 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-08-24 14:50:53 +0200 |
commit | ccc30eda6774eb99adc537f9747097e1e8a74b21 (patch) | |
tree | b9ba1c3d185fc95f873e19baeb2a99d1ed44e728 /sw | |
parent | a9d94a12d32f6e2a6bf9c459caa59c8327b64ff5 (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/+/120879
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
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 7fa40dba919e..7f000e1a59f1 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1490,7 +1490,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, |