diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-08 08:21:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-08 09:17:05 +0100 |
commit | 00212cdb3ee2bb0b4d8fb61a482a7f9f01c0a9b7 (patch) | |
tree | 2b1f71674e9210172e49dc6760c593ec1e19278f /sd/source/ui | |
parent | 2f27dd63d2c1dd36a1df898b72d1d4949ae8230c (diff) |
coverity#1237355 Dereference null return value
Change-Id: I66956979c494f96f76eb0a7840f28c8edc91d816
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index cfe75ff0a3c9..c588a2c1f2f7 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -652,19 +652,17 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) } ::sd::DrawDocShell* pDocShell(NULL); + ::sd::ViewShellBase* pBase(NULL); + SdDrawDocument* pDoc(NULL); if (pShell && pViewFrame) { pDocShell = PTR_CAST(::sd::DrawDocShell, pShell); + pDoc = pDocShell ? pDocShell->GetDoc() : NULL; + pBase = ::sd::ViewShellBase::GetViewShellBase(pViewFrame); } - if (pDocShell) + if (pDoc && pBase) { - SdDrawDocument* pDoc = pDocShell->GetDoc(); - - ::sd::ViewShellBase* pBase = - ::sd::ViewShellBase::GetViewShellBase ( - pViewFrame); - assert(pBase!=NULL); ::boost::shared_ptr<sd::ViewShell> pViewSh = pBase->GetMainViewShell(); SdOptions* pOptions = GetSdOptions(pDoc->GetDocumentType()); |