sw/source/uibase/app/swmodul1.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6c2e9d6bf457a7ca2cd39dd0fba110f5831cedc4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Feb 24 09:42:56 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Feb 24 12:45:53 2022 +0100

    cid#1500708 Dereference after null check
    
    and
    
    cid#1500691 Dereference after null check
    
    Change-Id: I4117e925fd8cb3323eb5335e9a6da98bfc8fb592
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130481
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/app/swmodul1.cxx 
b/sw/source/uibase/app/swmodul1.cxx
index fd0122fd3445..cf7d8b6282a0 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -291,6 +291,7 @@ void SwModule::ApplyUserCharUnit(bool bApplyChar, bool bWeb)
             GetUsrPref(false);
         pPref = m_pUsrPref.get();
     }
+    assert(pPref && "pPref is set by here");
     bool bOldApplyCharUnit = pPref->IsApplyCharUnit();
     bool bHasChanged = false;
     if(bOldApplyCharUnit != bApplyChar)
@@ -659,8 +660,9 @@ void SwModule::CheckSpellChanges( bool bOnlineSpelling,
 
 void SwModule::ApplyDefaultPageMode(bool bIsSquaredPageMode)
 {
-    if(!m_pUsrPref)
+    if (!m_pUsrPref)
         GetUsrPref(false);
+    assert(m_pUsrPref && "pPref is set by here");
     m_pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
 }
 

Reply via email to