sw/source/core/crsr/viscrs.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
New commits: commit 6391b398b4de77f9e12c940dc72fe334c3fa6b00 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Jun 25 10:17:52 2024 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Jun 27 10:13:42 2024 +0200 sw: fix crash in SwShellCursor::Show() Crashreport signature: > Fatal signal received: SIGSEGV code: 1 for address: 0x0 > program/libswlo.so > SwShellCursor::Show(SfxViewShell const*) > sw/source/core/crsr/viscrs.cxx:991 > program/libswlo.so > SwCursorShell::ShowCursors(bool) > sw/source/core/crsr/crsrsh.cxx:2769 > program/libswlo.so > SwViewShell::ImplEndAction(bool) > sw/source/core/view/viewsh.cxx:? > program/libswlo.so > SwViewShell::EndAction(bool) > sw/inc/viewsh.hxx:638 (cherry picked from commit cefe556b9198b5dba18256d30ddcfcfda03f18c8) Change-Id: I31e453fae20957b906ff82f967dd97bb571d58d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169538 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins (cherry picked from commit fba0193fcfb250d931c54baab2d1b79ce4be2f12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169553 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 090d0eb70421..d8cca3cfa1b8 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -988,7 +988,19 @@ void SwShellCursor::Show(SfxViewShell const * pViewShell) } else { - GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect); + const SwCursorShell* pShell = GetShell(); + if (!pShell) + { + return; + } + + SfxViewShell* pSfxViewShell = pShell->GetSfxViewShell(); + if (!pSfxViewShell) + { + return; + } + + pSfxViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect); SfxLokHelper::notifyOtherViews(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRect); } }