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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/core/unocore/SwXTextDefaults.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 9955b4417c59..5c6e25683098 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -219,8 +219,11 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName throw UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); Any aRet; SfxItemPool& rSet (m_pDoc->GetAttrPool()); - const SfxPoolItem *pItem = rSet.GetPoolDefaultItem ( pMap->nWID ); - pItem->QueryValue( aRet, pMap->nMemberId ); + SfxPoolItem const*const pItem = rSet.GetPoolDefaultItem(pMap->nWID); + if (pItem) + { + pItem->QueryValue( aRet, pMap->nMemberId ); + } return aRet; } |