accessibility: fix crash in getAccessibleActionDescription

See https://crashreport.libreoffice.org/stats/signature/SvTreeListEntry::HasChildren()

Change-Id: I21879ad531a5c61b3a6808c373454522557e2ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156403
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit e3b4bb25d4ef1684e1a370a34bc13ec65df23ea5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156433
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 013bb94..f456844 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -794,9 +794,10 @@ namespace accessibility
                //Sometimes, a List or Tree may have both checkbox and label at the same time
                return OUString();
            }
        }else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex == 0 )
        }
        else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex == 0 )
        {
            if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
            if( pEntry && (pEntry->HasChildren() || pEntry->HasChildrenOnDemand()) )
                return m_pTreeListBox->IsExpanded( pEntry ) ?
                AccResId(STR_SVT_ACC_ACTION_COLLAPSE) :
                AccResId(STR_SVT_ACC_ACTION_EXPAND);