sw/source/core/doc/textboxhelper.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fd63354d2d8c4906cc5ef7b3a1ce42b069e9aa9e
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Nov 18 16:50:45 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Nov 18 22:37:52 2024 +0100

    tdf#163486: PVS: dereferencing of a potential null pointer
    
    V522    There might be dereferencing of a potential null pointer.
    
    Change-Id: I23e4eba0399243ca67ecaa3101a327eece825687
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176722
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 89b51f0d3171..4f34b9e61a47 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -1605,8 +1605,11 @@ bool 
SwTextBoxHelper::DoTextBoxZOrderCorrection(SwFrameFormat* pShape, const Sdr
     SdrObject* pFrmObj = pTextBox->FindRealSdrObject();
     if (!pFrmObj)
     {
-        // During loading there is no ready SdrObj for z-ordering, so create 
and cache it here
-        pFrmObj = 
SwXTextFrame::GetOrCreateSdrObject(*dynamic_cast<SwFlyFrameFormat*>(pTextBox));
+        if (SwFlyFrameFormat* pFlyFrameFormat = 
dynamic_cast<SwFlyFrameFormat*>(pTextBox))
+        {
+            // During loading there is no ready SdrObj for z-ordering, so 
create and cache it here
+            pFrmObj = SwXTextFrame::GetOrCreateSdrObject(*pFlyFrameFormat);
+        }
     }
     if (!pFrmObj)
     {

Reply via email to