summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-21 15:32:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 15:52:22 +0000
commitd34bcb1053540a858958db8551bb2b4797caaf09 (patch)
treeb5b31edb9f5136697512de7383d8b23c4d30b642
parent813a1ea12da7f588c22cf40bd1d6b227bf01a539 (diff)
coverity#705961 Dereference before null check
Change-Id: I0737bbc738779a4ef282c7eea1406a796e0d663d
-rw-r--r--sw/source/core/uibase/uno/SwXDocumentSettings.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
index c8f684935113..0f4a84061a69 100644
--- a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
@@ -293,9 +293,11 @@ void SwXDocumentSettings::_preSetValues ()
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException )
{
mpDocSh = mpModel->GetDocShell();
- mpDoc = mpDocSh->GetDoc();
+ if (NULL == mpDocSh)
+ throw UnknownPropertyException();
- if( NULL == mpDoc || NULL == mpDocSh )
+ mpDoc = mpDocSh->GetDoc();
+ if (NULL == mpDoc)
throw UnknownPropertyException();
}