diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-15 18:38:38 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-23 18:55:55 +0000 |
commit | f391964c8d2c234d0cdb68322a2abaa4d26a6442 (patch) | |
tree | 7055870862d99bf35f1e7bb7f549216caaf734ad /sd | |
parent | 9bde8bdab1024b24a71d56a4355a5eacca720007 (diff) |
svx, sd, sw: GetPoolDefaultItem() can actually return nullptr
...if you call ResetPoolDefaultItem() first. Crash found by Varun Dhall.
Change-Id: I409484c172fb5843270aee2425844076a008b4df
(cherry picked from commit bcb1f81668d9b6a6d807ae32d60ccfce0b36ceb5)
Reviewed-on: https://gerrit.libreoffice.org/17320
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/stlpool.cxx | 5 |
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) |