[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sfx2/source

Caolán McNamara caolanm at redhat.com
Thu Dec 22 14:57:55 UTC 2016


 sfx2/source/view/lokhelper.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 4db6cac8589d4668c168e684b7cc45f08c622ec7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 19 10:32:47 2016 +0100

    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 at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index aa8c5cc..4aa35af 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)


More information about the Libreoffice-commits mailing list