diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 10:26:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 11:21:09 +0000 |
commit | a434a8bfdd8b9323c8262edcd591641fe9ea8b19 (patch) | |
tree | 44bcda4b3bb947c384bfb9bcd8e085e1ea516abd /sw | |
parent | de969207a606d0967bfa8a5dd7b2f180f8511f83 (diff) |
coverity#1130423 Dereference null return value
Change-Id: If6981a9654a114e34dad931381ea071d5169adc2
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/app/docst.cxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 0b8a6326efce..306206c649bd 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -1164,19 +1164,23 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, case SFX_STYLE_FAMILY_PSEUDO: { - pCurrWrtShell->StartAllAction(); + const SwNumRule* pCurRule = pCurrWrtShell->GetCurNumRule(); - SwNumRule aRule( *pCurrWrtShell->GetCurNumRule() ); - OUString sOrigRule( aRule.GetName() ); - // #i91400# - aRule.SetName( pStyle->GetNumRule()->GetName(), - *(pCurrWrtShell->GetDoc()) ); - pCurrWrtShell->ChgNumRuleFmts( aRule ); + if (pCurRule) + { + pCurrWrtShell->StartAllAction(); - pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() ); + SwNumRule aRule( *pCurRule ); + OUString sOrigRule( aRule.GetName() ); + // #i91400# + aRule.SetName( pStyle->GetNumRule()->GetName(), + *(pCurrWrtShell->GetDoc()) ); + pCurrWrtShell->ChgNumRuleFmts( aRule ); + pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() ); - pCurrWrtShell->EndAllAction(); + pCurrWrtShell->EndAllAction(); + } } break; } |