diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 10:41:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 13:14:01 +0000 |
commit | 0804c8239f8fb1b576485810030debd88ba12131 (patch) | |
tree | f64f6f95b2959cd1852d0f8b6073ffc117da6c8d /sw | |
parent | da0581b32c8b93bbdd4abc14e30010bab7873336 (diff) |
coverity#705502 Dereference null return value
Change-Id: I5f41ff8017879a75f088fc0aa1b8ce99f935a46f
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/atrstck.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index cfe91f8532b3..a623d454adfe 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -610,15 +610,20 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr ) const SwTxtAttr* pTopAt = aAttrStack[ nStackPos ].Top(); if ( pTopAt ) { + const SfxPoolItem* pItemNext(NULL); + // check if top attribute is collection of attributes if ( RES_TXTATR_INETFMT == pTopAt->Which() || RES_TXTATR_CHARFMT == pTopAt->Which() || RES_TXTATR_AUTOFMT == pTopAt->Which() ) { const SfxItemSet* pSet = CharFmt::GetItemSet( pTopAt->GetAttr() ); - const SfxPoolItem* pItemNext; - pSet->GetItemState( nAttr, RES_TXTATR_AUTOFMT != pTopAt->Which(), &pItemNext ); + if (pSet) + pSet->GetItemState( nAttr, RES_TXTATR_AUTOFMT != pTopAt->Which(), &pItemNext ); + } + if (pItemNext) + { Color aColor; if ( lcl_ChgHyperLinkColor( *pTopAt, *pItemNext, mpShell, &aColor ) ) { |