sw/source/uibase/utlui/content.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 9efc7e6980e3ada86bfd501fc7306f596abccbf5
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Oct 24 16:38:39 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Oct 24 18:53:54 2021 +0200

    cid#1460971 Unchecked return value
    
    Change-Id: Ic60242072a0ba7037cd8094ae98633b038c6f1eb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124120
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index c56a7fca4d83..b16599d5e960 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2766,7 +2766,11 @@ bool SwContentTree::HasContentChanged()
                         std::unique_ptr<weld::TreeIter> 
xEntry(m_xTreeView->make_iterator(xRootEntry.get()));
                         for (size_t j = 0; j < nChildCount; ++j)
                         {
-                            m_xTreeView->iter_next(*xEntry);
+                            if (!m_xTreeView->iter_next(*xEntry))
+                            {
+                                SAL_WARN("sw.ui", "unexpected missing entry");
+                                break;
+                            }
                             const SwContent* pCnt = pArrType->GetMember(j);
                             OUString 
sSubId(OUString::number(reinterpret_cast<sal_Int64>(pCnt)));
                             m_xTreeView->set_id(*xEntry, sSubId);

Reply via email to