diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-12-01 00:36:58 -0900 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-12-04 16:01:59 +0100 |
commit | c9d10718e2d39b0b063c4b17ed3fde07522458f7 (patch) | |
tree | 08283da656a3670a5c32cad95eee08272ead35ce /sw | |
parent | 60b195cd41f93fc24bfb7897bde20ac3cbeadd1f (diff) |
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.stahl@allotropia.de>
(cherry picked from commit ac21d937690c1ef995df22e11384e0fab226472e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126240
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index a7dc4d3f4323..234b6c5db0c5 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(); } } |