sw/source/filter/ww8/docxattributeoutput.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cf33327fec4a8bb440d94788eff1f35678c964e6
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Sep 28 08:54:50 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Sep 28 14:37:02 2023 +0200

    cid#1545341 Dereference after null check
    
    Change-Id: I58fc2f00667f6e3c12ab5a2d37b6ce923a996817
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157355
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7839f70cfa76..b809870dcf28 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2888,11 +2888,11 @@ void DocxAttributeOutput::StartField_Impl( const 
SwTextNode* pNode, sal_Int32 nP
     }
     else if (rInfos.eType == ww::eFILLIN)
     {
-        SwInputField const& rField(*static_cast<SwInputField 
const*>(rInfos.pField.get()));
-        if (rField.getGrabBagParams().hasElements())
+        const SwInputField* pField = static_cast<SwInputField 
const*>(rInfos.pField.get());
+        if (pField && pField->getGrabBagParams().hasElements())
         {
-            WriteSdtPlainText(rField.GetPar1(), rField.getGrabBagParams());
-            m_sRawText = rField.GetPar1();  // Write field content also as a 
fallback
+            WriteSdtPlainText(pField->GetPar1(), pField->getGrabBagParams());
+            m_sRawText = pField->GetPar1();  // Write field content also as a 
fallback
             return;
         }
     }

Reply via email to