diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-19 10:32:47 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-12-22 14:57:35 +0000 |
commit | 4db6cac8589d4668c168e684b7cc45f08c622ec7 (patch) | |
tree | 8d2426a836694e96ad20cce044a53196db1758c9 /sfx2 | |
parent | 0c2fda63a5713eda002f963d033841f15fca0f62 (diff) |
coverity#1371337 Dereference null return value
Change-Id: I209f28c1c78ffaec4f8f01b263e2e6320caa6a83
(cherry picked from commit fef09fe0ddd53530ab32dd9ec91fdd07c5567343)
Reviewed-on: https://gerrit.libreoffice.org/32342
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
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 aa8c5cc3852c..4aa35af5edb8 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -27,10 +27,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) |