summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-08-31 12:46:54 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-08-31 13:11:33 -0400
commit98ec92335d18bb361a63cea3e1e71a87dddded2b (patch)
tree4bedab364f80425ba3d047ad7718b32d125a096f
parent4bcd9947774c05df6031e3b2228939150aa8c78b (diff)
fdo#54303: Prevent crash on load.
Another simple null pointer check, to save the day. This unfortunately prevents the properties of the skipped field from being loaded properly, but it's still better than a immediate crash. Change-Id: I49398d80eb3bf0834b7e9830ac8be3ac776cb354 Signed-off-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/filter/excel/xipivot.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 2d30efb0d35e..8f9596a8a067 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1091,7 +1091,11 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con
if( !pCacheField || !pCacheField->IsSupportedField() )
return 0;
- ScDPSaveDimension& rSaveDim = *rSaveData.GetNewDimensionByName( rFieldName );
+ ScDPSaveDimension* pTest = rSaveData.GetNewDimensionByName(rFieldName);
+ if (!pTest)
+ return NULL;
+
+ ScDPSaveDimension& rSaveDim = *pTest;
// orientation
rSaveDim.SetOrientation( static_cast< sal_uInt16 >( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOLPAGE ) ) );