sfx2/source/view/lokhelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit a2b22f5b551cb2030cd29d3dd3510fca42a0bfc1 Author: Miklos Vajna <[email protected]> AuthorDate: Tue Nov 26 09:14:02 2024 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Nov 26 15:02:09 2024 +0100 sfx2 lok: fix crash in SfxLokHelper::notifyUpdate() Crashreport signature: > kit-09946-09946 2024-11-25 16:46:13.180120 +0000 [ kitbroker_498 ] SIG Fatal signal received: SIGSEGV code: 1 for address: 0x0 > program/libmergedlo.so > SfxLokHelper::notifyUpdate(SfxViewShell const*, int) > sfx2/source/view/lokhelper.cxx:1072 > program/libswlo.so > SwViewShell::GetSfxViewShell() const > sw/inc/viewsh.hxx:472 > program/libswlo.so > SwCursorShell::UpdateCursor(unsigned short, bool) > sw/source/core/crsr/crsrsh.cxx:2382 ... > 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, handle this in SfxLokHelper::notifyUpdate() till it takes a pointer and not a reference. Change-Id: Ifa5d9300029076e91ba8722152a7d91a1f2ecbc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177315 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 972a1ca623a9..ed37f902a654 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -1066,7 +1066,7 @@ void SfxLokHelper::getCommandValues(tools::JsonWriter& rJsonWriter, std::string_ void SfxLokHelper::notifyUpdate(SfxViewShell const* pThisView, int nType) { - if (DisableCallbacks::disabled()) + if (DisableCallbacks::disabled() || !pThisView) return; pThisView->libreOfficeKitViewUpdatedCallback(nType);
