vcl/source/treelist/treelist.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ef41b8211ff8a63d89c6fb3bd5c14e560aa73219
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Wed Jun 15 16:54:55 2022 +0200
Commit:     Samuel Mehrbrodt <[email protected]>
CommitDate: Wed Jun 15 16:57:49 2022 +0200

    Make sure pEntry is not null
    
    Crash seen:
    >       mergedlo.dll!SvTreeList::GetDepth(const SvTreeListEntry * pEntry) 
line 106
            mergedlo.dll!SalInstanceTreeView::get_iter_depth(const 
weld::TreeIter & rIter) line 4230
            basctllo.dll!basctl::SbTreeListBox::FindVariable(const 
weld::TreeIter * pEntry) line 271
            basctllo.dll!basctl::SbTreeListBox::FindModule(const weld::TreeIter 
* pEntry) line 695
            basctllo.dll!basctl::MacroChooser::BasicSelectHdl(weld::TreeView & 
__formal) line 473
            basctllo.dll!basctl::MacroChooser::RestoreMacroDescription() line 
158
            basctllo.dll!basctl::MacroChooser::run() line 178
    
    Change-Id: Ic85758c0bbee952d0a23b1d52e8bbdd231e8de26

diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 681bef4d0c7d..69a3284a495c 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -103,7 +103,7 @@ sal_uInt16 SvTreeList::GetDepth( const SvTreeListEntry* 
pEntry ) const
 {
     DBG_ASSERT(pEntry && pEntry!=pRootItem.get(),"GetDepth:Bad Entry");
     sal_uInt16 nDepth = 0;
-    while( pEntry->pParent != pRootItem.get() )
+    while( pEntry && pEntry->pParent != pRootItem.get() )
     {
         nDepth++;
         pEntry = pEntry->pParent;

Reply via email to