summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-12-01 00:36:58 -0900
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-12-04 16:01:50 +0100
commit10a4fad01480fcfe45060cc9618f2fe6000a0ab5 (patch)
tree50058023d2df5825a2fcbf73989f1fcbc4e86b3e /sw
parent4990df35e5036d78599c54884810b062c834def7 (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/+/126241 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index f1b3a329f937..c636ad174353 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1749,7 +1749,8 @@ void SwPostItMgr::Hide()
for (auto const& postItField : mvPostItFields)
{
postItField->mbShow = false;
- postItField->mpPostIt->HideNote();
+ if (postItField->mpPostIt)
+ postItField->mpPostIt->HideNote();
}
}