sw/source/ui/fldui/DateFormFieldDialog.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 62df8eaee0d94dd347a10203499b714e6e1c658a
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Aug 3 21:33:53 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Aug 7 12:58:59 2025 +0200

    cid#1660815 Dereference null return value
    
    Change-Id: I47c9e02859f69df1f1849113fcb52a217eb26193
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188888
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit f1d7cedf2cd656bb19c68d0797b536c56f0e2683)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189047
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/ui/fldui/DateFormFieldDialog.cxx 
b/sw/source/ui/fldui/DateFormFieldDialog.cxx
index d7d3fd9ea7c9..f3516e8c7306 100644
--- a/sw/source/ui/fldui/DateFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DateFormFieldDialog.cxx
@@ -42,13 +42,15 @@ DateFormFieldDialog::~DateFormFieldDialog() {}
 
 void DateFormFieldDialog::Apply()
 {
-    if (m_pDateField == nullptr)
+    if (!m_pDateField)
         return;
 
     // Try to find out the current date value and replace the content
     // with the right formatted date string
     sw::mark::Fieldmark::parameter_map_t* pParameters = 
m_pDateField->GetParameters();
     const SvNumberformat* pFormat = 
m_pNumberFormatter->GetEntry(m_xFormatLB->GetFormat());
+    if (!pFormat)
+        return;
 
     // Get date value first
     std::pair<bool, double> aResult = m_pDateField->GetCurrentDate();

Reply via email to