[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 3 13:37:13 UTC 2021


 sfx2/source/appl/childwin.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 2337f70a7631a5d644b123fcbbed375395daa666
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 2 20:39:37 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 3 15:36:39 2021 +0200

    cid#1492221 silence bogus Dereference after null check
    
    Change-Id: I4e0554d16cac67bd8d829ed5e65fd4b17f4cf1b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123008
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index f03489bf688d..09e97f6de3da 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -246,8 +246,11 @@ std::unique_ptr<SfxChildWindow> SfxChildWindow::CreateChildWindow( sal_uInt16 nI
         }
     }
 
-    if ( pChild )
+    if (pChild)
+    {
+        assert(pFact && "pChild is returned by a call on pFact, so pFact cannot be null");
         pChild->SetFactory_Impl( pFact );
+    }
 
     DBG_ASSERT(pFact && (pChild || !rInfo.bVisible), "ChildWindow-Typ not registered!");
 


More information about the Libreoffice-commits mailing list