From e7e5b43c4906d9f0e199f689addc29aa98916e6e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 18 Oct 2023 16:47:20 +0100 Subject: crashreporting: svx::SentenceEditWindow_Impl::CreateSpellPortions() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cui/source/dialogs/SpellDialog.cxx:2005 aRet[ aRet.size() - 1 ].sText += aLeftOverText; presumably aRet is empty() here a) don't bother appending if aLeftOverText is empty() b) don't crah if aRet is empty() and aLeftOverText is not Change-Id: Ie9a9585f572d8afb17183b479fb6f2cce5952aa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158124 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/dialogs/SpellDialog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 1e52d4e2aed3..67de5235d1ad 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -2066,7 +2066,7 @@ svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions() const aPortion2.sText = aLeftOverText.makeStringAndClear(); aRet.push_back( aPortion2 ); } - else + else if (!aLeftOverText.isEmpty() && !aRet.empty()) { // we just need to append the left-over text to the last portion (which had no errors) aRet[ aRet.size() - 1 ].sText += aLeftOverText; } -- cgit