diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-11-29 08:52:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-29 11:31:24 +0100 |
commit | 95ef3535aa874c60d0453813d157f41e90365cca (patch) | |
tree | a360d6d60aa82030261349a0dc6f76630df3bd66 /sfx2 | |
parent | baae9e6423c4d281094abfd9fb11c1ba30342d44 (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/+/177513
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index ed37f902a654..ba00e0898234 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -1090,8 +1090,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); |