sw/source/uibase/utlui/glbltree.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit b092ae051549f9577c8603235515f79ca8af5156
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Sep 19 12:27:05 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Sep 19 14:44:04 2021 +0200

    cid#1492160 Dereference before null check
    
    Change-Id: If53b117a69c37907c4d3871eec6c8b3ecfc9c461
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122314
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 81c351f7249a..3594c0a198ab 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -793,12 +793,9 @@ void SwGlobalTree::UpdateTracking()
     if (pActiveShellCurrSection)
     {
         const SwSection* pSection = pActiveShellCurrSection;
-        SwSection* pParent;
-        while ((pParent = pSection->GetParent()) != nullptr)
+        while (SwSection* pParent = pSection->GetParent())
             pSection = pParent;
-
-        if (pSection)
-            m_xTreeView->select_text(pSection->GetSectionName());
+        m_xTreeView->select_text(pSection->GetSectionName());
     }
 }
 

Reply via email to