diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2022-08-19 14:24:57 +0530 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2022-08-19 16:01:58 +0200 |
commit | 21d62f4d98b111784562c32dc3ea02ea034999e9 (patch) | |
tree | 5d202000ea11e3b86d0f5b96a85f796f8483eede | |
parent | 3b37b9b09973a4b4a7aab40f2525113c5eb4cffb (diff) |
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.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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) |