diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-19 10:32:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-19 13:00:44 +0100 |
commit | fef09fe0ddd53530ab32dd9ec91fdd07c5567343 (patch) | |
tree | 5cc560e3a2bba4c7480fa46db8fb3d0b18be2767 /sfx2 | |
parent | 87e520e7b26c3eaf07ed10dcd0cb0f7f5cebd14d (diff) |
coverity#1371337 Dereference null return value
Change-Id: I209f28c1c78ffaec4f8f01b263e2e6320caa6a83
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 41131604709a..7a23e1b5dbee 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -25,10 +25,14 @@ using namespace com::sun::star; int SfxLokHelper::createView() { SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(); + if (!pViewFrame) + return -1; SfxRequest aRequest(pViewFrame, SID_NEWWINDOW); pViewFrame->ExecView_Impl(aRequest); - - return SfxViewShell::Current()->GetViewShellId(); + SfxViewShell* pViewShell = SfxViewShell::Current(); + if (!pViewShell) + return -1; + return pViewShell->GetViewShellId(); } void SfxLokHelper::destroyView(int nId) |