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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 21 13:52:51 UTC 2021


 starmath/source/edit.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3902cfcd14cc66ee52b6d5bca7621bf30d6f4095
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 21 11:23:04 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 21 15:52:07 2021 +0200

    cid#1476301 Dereference null return value
    
    Change-Id: I7dff59f18fdf08389e7f279001627da4e5e3baeb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114392
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index a02ad7436500..4c3549ec8d62 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -784,8 +784,9 @@ void SmEditTextWindow::UpdateStatus(bool bSetDocModified)
     SmModule *pMod = SM_MOD();
     if (pMod && pMod->GetConfig()->IsAutoRedraw())
         Flush();
-    if ( bSetDocModified )
-        mrEditWindow.GetDoc()->SetModified();
+    SmDocShell* pDoc = bSetDocModified ? mrEditWindow.GetDoc() : nullptr;
+    if (pDoc)
+        pDoc->SetModified();
 }
 
 void SmEditWindow::Cut()


More information about the Libreoffice-commits mailing list