summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-15 18:38:38 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-15 18:38:38 +0200
commitbcb1f81668d9b6a6d807ae32d60ccfce0b36ceb5 (patch)
tree24a0c2978e602cd72c2c8552162e9f1249b36c0d /sd
parent9fb8b3968670645b257982773ece9d9413f404c6 (diff)
svx, sd, sw: GetPoolDefaultItem() can actually return nullptr
...if you call ResetPoolDefaultItem() first. Crash found by Varun Dhall. Change-Id: I409484c172fb5843270aee2425844076a008b4df
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/stlpool.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index f4eee3948da8..a45bbaa706ed 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1127,7 +1127,10 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
case HID_PSEUDOSHEET_SUBTITLE :
{
// Subtitle template
- SvxNumRule* pDefaultRule = static_cast<const SvxNumBulletItem*>( rSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET))->GetNumRule();
+ SvxNumBulletItem const*const pItem(
+ static_cast<const SvxNumBulletItem*>(
+ rSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET)));
+ SvxNumRule *const pDefaultRule = (pItem) ? pItem->GetNumRule() : nullptr;
DBG_ASSERT( pDefaultRule, "Where is my default template? [CL]" );
if(pDefaultRule)