diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 15:32:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 15:52:22 +0000 |
commit | d34bcb1053540a858958db8551bb2b4797caaf09 (patch) | |
tree | b5b31edb9f5136697512de7383d8b23c4d30b642 | |
parent | 813a1ea12da7f588c22cf40bd1d6b227bf01a539 (diff) |
coverity#705961 Dereference before null check
Change-Id: I0737bbc738779a4ef282c7eea1406a796e0d663d
-rw-r--r-- | sw/source/core/uibase/uno/SwXDocumentSettings.cxx | 6 |
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(); } |