sw/source/uibase/docvw/PostItMgr.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 174d78a887b0f80bad149f16e1e3b53e04ba8af7
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Fri Aug 19 14:24:57 2022 +0530
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Aug 19 19:17:49 2022 +0200

    added nullptr guard
    
    solves the segfault introduced in d365da2c4
    
    Change-Id: Ic9ab0c9e18a562cdc2120b1e1300c9b44e3f0900
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138522
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index e21209a79766..cb07ee9c33a5 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -250,7 +250,10 @@ bool SwPostItMgr::CheckForRemovedPostIts()
         if (!(*it)->UseElement(*mpWrtShell->GetLayout(), rIDRA))
         {
             
EndListening(const_cast<SfxBroadcaster&>(*(*it)->GetBroadcaster()));
-            lcl_CommentNotification(mpView, CommentNotificationType::Remove, 
nullptr, (*it)->mpPostIt->GetPostItField()->GetPostItId());
+
+            if((*it)->mpPostIt && (*it)->mpPostIt->GetPostItField())
+                lcl_CommentNotification(mpView, 
CommentNotificationType::Remove, nullptr, 
(*it)->mpPostIt->GetPostItField()->GetPostItId());
+
             std::unique_ptr<SwSidebarItem> p = std::move(*it);
             it = mvPostItFields.erase(it);
             if (GetActiveSidebarWin() == p->mpPostIt)

Reply via email to