sw/qa/extras/uiwriter/uiwriter9.cxx | 1 + 1 file changed, 1 insertion(+)
New commits: commit 959c4d07dbc6f029cd842f1312cb0ba87bde0016 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Sep 16 09:44:41 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Sep 16 08:15:53 2025 +0200 Fix warning C6011: Dereferencing NULL pointer in sw The API indeed can return a nullptr; so we need to test the result. Change-Id: Ic589fc7235b3d51a71a881de60be8676fa58d750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191012 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index e0bf576ac8ca..14434482aa21 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -1655,6 +1655,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf168355) SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); const SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); const SwPageFrame* pPageFrm = static_cast<const SwPageFrame*>(pLayout->Lower()); + CPPUNIT_ASSERT(pPageFrm); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pPageFrm->GetVirtPageNum()); pPageFrm = static_cast<const SwPageFrame*>(pPageFrm->GetNext()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pPageFrm->GetVirtPageNum());