sc/source/ui/unoobj/dapiuno.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5de1567e30d54fde33875d7c8301bf3d36d6f1cd
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun May 22 12:11:28 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun May 22 15:16:12 2022 +0200

    cid#1504539 Dereference before null check
    
    seeing as its always derefed before here, the null check isn't useful
    
    Change-Id: I7c50d357978c7468eec469b4f32601e9b99e07e2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134728
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 162e8ceb9565..dfd11971e88f 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1260,7 +1260,7 @@ void ScDataPilotTableObj::Refreshed_Impl()
 
 ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) :
     ScDataPilotDescriptorBase( pDocSh ),
-    mpDPObject(new ScDPObject(pDocSh ? &pDocSh->GetDocument() : nullptr) )
+    mpDPObject(new ScDPObject(&pDocSh->GetDocument()))
 {
     ScDPSaveData aSaveData;
     // set defaults like in ScPivotParam constructor
@@ -1269,7 +1269,7 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* 
pDocSh) :
     aSaveData.SetIgnoreEmptyRows( false );
     aSaveData.SetRepeatIfEmpty( false );
     mpDPObject->SetSaveData(aSaveData);
-    ScSheetSourceDesc aSheetDesc(pDocSh ? &pDocSh->GetDocument() : nullptr);
+    ScSheetSourceDesc aSheetDesc(&pDocSh->GetDocument());
     mpDPObject->SetSheetDesc(aSheetDesc);
 }
 

Reply via email to