summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-11-29 08:52:11 +0100
committerMiklos Vajna <vmiklos@collabora.com>2024-11-29 13:36:06 +0100
commit9f25e61d0e9bbd762ef6da063c16c65e53c9c980 (patch)
tree2eedcd8781ce29ab52e27676e785eb434cd8bb7c /sfx2/source
parentcaf0071d604eca7fc7b89e9ecfa7a686157ca797 (diff)
sfx2 lok: fix crash in SfxLokHelper::notifyOtherViewsUpdatePerViewId()
Crashreport signature: > SIG Fatal signal received: SIGSEGV code: 1 for address: 0x0 > program/libmergedlo.so > SfxLokHelper::notifyOtherViewsUpdatePerViewId(SfxViewShell const*, int) > sfx2/source/view/lokhelper.cxx:1098 > program/libswlo.so > SwSelPaintRects::Show(std::vector<rtl::OString, std::allocator<rtl::OString> >*) > sw/source/core/crsr/viscrs.cxx:514 ... > program/libswlo.so > SwWrtShell::SwWrtShell(SwDoc&, vcl::Window*, SwView&, SwViewOption const*) > sw/source/uibase/wrtsh/wrtsh1.cxx:2032 ... > program/libmergedlo.so > framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) > framework/source/services/desktop.cxx:592 I.e. it can happen that during load we don't yet have a view, similar to commit a2b22f5b551cb2030cd29d3dd3510fca42a0bfc1 (sfx2 lok: fix crash in SfxLokHelper::notifyUpdate(), 2024-11-26). Change-Id: Id17a61296a181a2ba4909b633d46a3c9d7aacb02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/view/lokhelper.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index ce3822502a36..19891df77ce4 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -1087,8 +1087,7 @@ void SfxLokHelper::notifyUpdatePerViewId(SfxViewShell const* pTargetShell, SfxVi
void SfxLokHelper::notifyOtherViewsUpdatePerViewId(SfxViewShell const* pThisView, int nType)
{
- assert(pThisView != nullptr && "pThisView must be valid");
- if (DisableCallbacks::disabled())
+ if (DisableCallbacks::disabled() || !pThisView)
return;
int viewId = SfxLokHelper::getView(pThisView);