diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-08 11:55:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-08 11:55:52 +0000 |
commit | 2a2b6d3e137c1f23b7bd8a093a228063338f56e9 (patch) | |
tree | b6278f989c8392d443ade1a725af695c0812a115 /sw | |
parent | 6a4eaa43b64d243d350e080ddfb95bc40d5681b2 (diff) |
coverity#704961 Dereference after null check
Change-Id: I6acca68cbebf149f7ac7f18fa0011e7f3d20a957
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 84d71489b8cb..710150628680 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1876,7 +1876,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, break; } } - if(!pCharFmt) + if(!pCharFmt && pBasePool) { SfxStyleSheetBase* pBase; @@ -2026,14 +2026,17 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, sal_Int16 nIdx = GetCommandContextIndex( pSeq[i].Name ); - pBasePool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL ); bool bStyleFound = false; - const SfxStyleSheetBase* pBase = pBasePool->First(); - while (pBase && !bStyleFound) + if (pBasePool) { - if(pBase->GetName() == aStyleName) - bStyleFound = true; - pBase = pBasePool->Next(); + pBasePool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL ); + const SfxStyleSheetBase* pBase = pBasePool->First(); + while (pBase && !bStyleFound) + { + if(pBase->GetName() == aStyleName) + bStyleFound = true; + pBase = pBasePool->Next(); + } } if (nIdx == -1 || !bStyleFound) |