From 2f2f39309c33800f6b751062f26b645d4fd9b050 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 28 Sep 2022 09:09:03 +0200 Subject: cui: fix crash in SpellDialog::SpellContinue_Impl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Crashreport signature: Fatal signal received: SIGSEGV code: 128 for address: 0x0 program/libcuilo.so svx::SpellDialog::GetNextSentence_Impl(std::unique_ptr >*, bool, bool) include/com/sun/star/uno/Reference.hxx:114 program/libcuilo.so svx::SpellDialog::SpellContinue_Impl(std::unique_ptr >*, bool, bool) cui/source/dialogs/SpellDialog.cxx:355 program/libcuilo.so svx::SpellDialog::ChangeHdl(weld::Button&) include/rtl/ustring.hxx:527 program/libmergedlo.so Control::ImplCallEventListenersAndHandler(VclEventId, std::function const&) include/rtl/ref.hxx:208 program/libmergedlo.so Button::Click() /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/std_function.h:244 Change-Id: I2c7267118213ea7d915a28d77badf93f8ff75683 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140586 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140689 Tested-by: Jenkins (cherry picked from commit 9be24f694d42fc9cae55ed911e0dff7f729803f1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140611 Reviewed-by: Caolán McNamara (cherry picked from commit ae1f8a426338770f0dd46c72553c405158415e65) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140761 --- cui/source/dialogs/SpellDialog.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cui') diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 329b20d54e29..9f110c6a5aa1 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -351,6 +351,11 @@ void SpellDialog::SpellContinue_Impl(std::unique_ptr* pGua //then GetNextSentence() has to be called followed again by MarkNextError() //MarkNextError is not initially called if the UndoEdit mode is active bool bNextSentence = false; + if (!m_xSentenceED) + { + return; + } + if(!((!m_xSentenceED->IsUndoEditMode() && m_xSentenceED->MarkNextError( bIgnoreCurrentError, xSpell )) || ( bNextSentence = GetNextSentence_Impl(pGuard, bUseSavedSentence, m_xSentenceED->IsUndoEditMode()) && m_xSentenceED->MarkNextError( false, xSpell )))) return; -- cgit