summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-02-08 09:04:14 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2023-02-15 17:02:20 +0000
commit68f7599f6e7a8a8d1f209bc44e4cf28c7672825b (patch)
tree0c24f1be283c41ae209b821fec9b3b48425d266f
parentffed1616ef4da1248ac64559064d014aa028467b (diff)
sw: fix crash in SwView::AttrChangedNotify()
Crashreport signature: program/../program/libswlo.so SwView::AttrChangedNotify(LinkParamNone*) sw/source/uibase/uiview/view.cxx:507 program/../program/libswlo.so SwWrtShell::DrawSelChanged() sw/source/uibase/wrtsh/wrtsh3.cxx:261 program/../program/libswlo.so SwDrawView::MarkListHasChanged() sw/source/core/draw/dview.cxx:767 program/libmergedlo.so SdrMarkView::MarkObj(SdrObject*, SdrPageView*, bool, bool, std::vector<basegfx::B2DRange, std::allocator<basegfx::B2DRange> >&&) svx/source/svdraw/svdmrkv.cxx:2196 program/../program/libswlo.so SwDrawContact::DisconnectFromLayout(bool) /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/stl_vector.h:336 This seems to happen when the SwDrawContent delete is in progress, so we no longer have the shells at hand that are usually present. Change-Id: Iba0601654c946b85e7c2de33fe76d99b26a20eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147052 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit dab3de66e057f8d6794c427fb38cb2e333dfc93f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147060 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/uibase/uiview/view.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 03085bcfc248..0808b37a71f8 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -528,6 +528,11 @@ IMPL_LINK_NOARG(SwView, AttrChangedNotify, LinkParamNone*, void)
if ( GetEditWin().IsChainMode() )
GetEditWin().SetChainMode( false );
+ if (!m_pWrtShell || !GetDocShell())
+ {
+ return;
+ }
+
//Opt: Not if PaintLocked. During unlock a notify will be once more triggered.
if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt &&
GetDocShell()->IsReadOnly() )