oox/qa/unit/testscene3d.cxx             |    1 +
 vcl/qa/cppunit/filter/ipdf/ipdf.cxx     |    4 +++-
 xmlsecurity/qa/unit/signing/signing.cxx |    4 +++-
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b4e42bce5581e6c1956607a5cb49837ad85b862b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu May 16 16:36:14 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu May 16 20:31:57 2024 +0200

    WaE: C6011 Dereferencing NULL pointer warnings
    
    Change-Id: I710ff75d387b2d452cb80911c9f0092948453ef8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167751
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx
index d43209a0a2c4..08d24ded2afc 100644
--- a/oox/qa/unit/testscene3d.cxx
+++ b/oox/qa/unit/testscene3d.cxx
@@ -63,6 +63,7 @@ uno::Reference<drawing::XShape> 
TestScene3d::getShape(sal_uInt8 nShapeIndex, sal
 void TestScene3d::getShapeAsBitmap(BitmapEx& rBMP, sal_uInt8 nShapeIndex)
 {
     SfxViewShell* pViewShell = SfxViewShell::Current();
+    CPPUNIT_ASSERT(pViewShell);
     SdrView* pSdrView = pViewShell->GetDrawView();
 
     // Mark object and convert it to bitmap
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx 
b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index 1c0b0625ce68..92c024bd34fa 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -100,7 +100,9 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, 
testPDFAddVisibleSignatureLastPage)
     {
         return;
     }
-    SdrView* pView = SfxViewShell::Current()->GetDrawView();
+    SfxViewShell* pCurrent = SfxViewShell::Current();
+    CPPUNIT_ASSERT(pCurrent);
+    SdrView* pView = pCurrent->GetDrawView();
     svx::SignatureLineHelper::setShapeCertificate(pView, xCert);
 
     // the document is modified now, but Sign function can't show SaveAs dialog
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 11bd8627c4d0..5c91c17ffb1c 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -755,7 +755,9 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testPDFAddVisibleSignature)
     {
         return;
     }
-    SdrView* pView = SfxViewShell::Current()->GetDrawView();
+    SfxViewShell* pCurrent = SfxViewShell::Current();
+    CPPUNIT_ASSERT(pCurrent);
+    SdrView* pView = pCurrent->GetDrawView();
     svx::SignatureLineHelper::setShapeCertificate(pView, aCertificates[0]);
 
     // the document is modified now, but Sign function can't show SaveAs dialog

Reply via email to