diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-14 11:24:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-14 11:24:25 +0000 |
commit | 08a8174d17fa32f709546e63c26fcf8a7c4f8255 (patch) | |
tree | c1d9c4b066d3e99b721448eba88b2b20d8f92d53 /sc/source | |
parent | d7e28300057645362ce32909c077b107f0a5c270 (diff) |
coverity#1398581 Dereference after null check
and
coverity#1398582 Dereference after null check
Change-Id: I6cbf11c30aac3e9dd7eb0727063a79369fb3e059
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/dptabres.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index b62c88b4af8d..a98d800078d6 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -2609,11 +2609,11 @@ void ScDPDataMember::UpdateRunningTotals( { double nTotal; if ( eRefType == sheet::DataPilotFieldReferenceType::ROW_PERCENTAGE ) - nTotal = pRowTotalData->GetAuxiliary(); + nTotal = pRowTotalData ? pRowTotalData->GetAuxiliary() : 0.0; else if ( eRefType == sheet::DataPilotFieldReferenceType::COLUMN_PERCENTAGE ) - nTotal = pColTotalData->GetAuxiliary(); + nTotal = pColTotalData ? pColTotalData->GetAuxiliary() : 0.0; else - nTotal = pGrandTotalData->GetAuxiliary(); + nTotal = pGrandTotalData ? pGrandTotalData->GetAuxiliary() : 0.0; if ( nTotal == 0.0 ) pAggData->SetError(); @@ -2623,9 +2623,9 @@ void ScDPDataMember::UpdateRunningTotals( break; case sheet::DataPilotFieldReferenceType::INDEX: { - double nColTotal = pColTotalData->GetAuxiliary(); - double nRowTotal = pRowTotalData->GetAuxiliary(); - double nGrandTotal = pGrandTotalData->GetAuxiliary(); + double nColTotal = pColTotalData ? pColTotalData->GetAuxiliary() : 0.0; + double nRowTotal = pRowTotalData ? pRowTotalData->GetAuxiliary() : 0.0; + double nGrandTotal = pGrandTotalData ? pGrandTotalData->GetAuxiliary() : 0.0; if ( nRowTotal == 0.0 || nColTotal == 0.0 ) pAggData->SetError(); else |