summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-07 16:16:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-08-07 18:00:52 +0100
commit349b218add66fd8d694c2dd95047a7d9caef4f0d (patch)
tree4c18cc2746f392208c3dff9abfb35b59dac1a179
parent41a5730b07d0b1749fa9a1b7f9ceea64b3b2cacf (diff)
coverity#704904 Dereference after null check
Change-Id: I5ef95b90f7eeb4777f9a847c42a09f2fab5f1e0c
-rw-r--r--sw/source/core/layout/flyincnt.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 3f0bc43764c1..14e0ad9698c8 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -84,12 +84,13 @@ void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
bool bCallPrepare = false;
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- if( RES_ATTRSET_CHG == nWhich )
+ if (RES_ATTRSET_CHG == nWhich && pNew)
{
- if( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->
- GetItemState( RES_SURROUND, false ) ||
+ if(pOld &&
+ (SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->
+ GetItemState(RES_SURROUND, false) ||
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->
- GetItemState( RES_FRMMACRO, false ) )
+ GetItemState(RES_FRMMACRO, false)) )
{
SwAttrSetChg aOld( *(SwAttrSetChg*)pOld );
SwAttrSetChg aNew( *(SwAttrSetChg*)pNew );