diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-22 12:04:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-22 15:34:01 +0200 |
commit | 3446419b22a50a9baa5e57aa3939025b4417d843 (patch) | |
tree | a9570b5efd90777c74fe49dea832da42da8a9a7b /sd/source | |
parent | 873bf8a7544fb1a9969e6a2670cf61645efc71ee (diff) |
null deref seen in SdXImpressDocument::getPostIts
Change-Id: Idb222476c6d2a6bb8e3ffea528ec4bed0c869ac8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172252
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 247c4810b9e8..df18005f934d 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2697,12 +2697,13 @@ Size SdXImpressDocument::getDocumentSize() void SdXImpressDocument::getPostIts(::tools::JsonWriter& rJsonWriter) { auto commentsNode = rJsonWriter.startNode("comments"); + if (!mpDoc) + return; // Return annotations on master pages too ? const sal_uInt16 nMaxPages = mpDoc->GetPageCount(); - SdPage* pPage; for (sal_uInt16 nPage = 0; nPage < nMaxPages; ++nPage) { - pPage = static_cast<SdPage*>(mpDoc->GetPage(nPage)); + SdrPage* pPage = mpDoc->GetPage(nPage); for (auto const& xAnnotation : pPage->getAnnotations()) { |