sfx2/source/view/lokhelper.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dc17158c99c8a15fbca57a9a0b0ea7178dcc5a34
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Thu Jan 26 03:31:24 2023 +0100
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Thu Jan 26 13:31:29 2023 +0000

    sfx2: fix crash in SfxLokHelper::notifyAllViews(...)
    
    Crashreport signature:
    
    program/libmergedlo.so
            SfxLokHelper::notifyAllViews(int, rtl::OString const&)
                    sfx2/source/view/lokhelper.cxx:682
    program/libmergedlo.so
            SfxClipboardChangeListener::ChangedContents()
                    include/rtl/string.hxx:413
    program/libmergedlo.so
            SfxClipboardChangeListener::LinkStubAsyncExecuteHdl_Impl(void*, 
void*)
                    include/rtl/ref.hxx:128
    program/libmergedlo.so
            ImplWindowFrameProc(vcl::Window*, SalEvent, void const*)
                    include/rtl/ref.hxx:128
    program/libmergedlo.so
            SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent)
    
    Change-Id: Ibf70f42292d67a3d6cc68f579ee02f671da85acb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146150
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 6bcae009bc1e..9f34d31c5766 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -676,6 +676,8 @@ void SfxLokHelper::notifyAllViews(int nType, const OString& 
rPayload)
 
     const auto payload = rPayload.getStr();
     const SfxViewShell* const pCurrentViewShell = SfxViewShell::Current();
+    if (!pCurrentViewShell)
+        return;
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
     while (pViewShell)
     {

Reply via email to