From 3446419b22a50a9baa5e57aa3939025b4417d843 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 22 Aug 2024 12:04:30 +0100 Subject: null deref seen in SdXImpressDocument::getPostIts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idb222476c6d2a6bb8e3ffea528ec4bed0c869ac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172252 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sd/source/ui/unoidl/unomodel.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sd/source') 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(mpDoc->GetPage(nPage)); + SdrPage* pPage = mpDoc->GetPage(nPage); for (auto const& xAnnotation : pPage->getAnnotations()) { -- cgit