sw/source/uibase/docvw/PostItMgr.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 21d62f4d98b111784562c32dc3ea02ea034999e9 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Fri Aug 19 14:24:57 2022 +0530 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Fri Aug 19 16:01:58 2022 +0200 added nullptr guard solves the segfault introduced in d365da2c4 Change-Id: Ic9ab0c9e18a562cdc2120b1e1300c9b44e3f0900 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138431 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 1e19fc371142..4a6e62e6f5c4 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -247,7 +247,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)