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

New commits:
commit ac21d937690c1ef995df22e11384e0fab226472e
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Wed Dec 1 00:36:58 2021 -0900
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Dec 2 11:15:35 2021 +0100

    Check pointer to prevent crash
    
    Prevents crash when postit is in a hidden section or folded outline
    content and SwPostItMgr::Hide function is called. In these cases the
    pointer to the postit annotation window could be nullptr.
    
    Change-Id: I16d08504cdd89bdb136f8a0d2615cf3028ca8ece
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126175
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index f6d5563895fc..bd8eb7c348f8 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1747,7 +1747,8 @@ void SwPostItMgr::Hide()
     for (auto const& postItField : mvPostItFields)
     {
         postItField->mbShow = false;
-        postItField->mpPostIt->HideNote();
+        if (postItField->mpPostIt)
+            postItField->mpPostIt->HideNote();
     }
 }
 

Reply via email to