sw/source/core/undo/SwUndoTOXChange.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit 32c39e510aba585fd6675e3497e158efab74b8a4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Nov 16 16:50:03 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Nov 16 18:51:06 2019 +0100 cid#1448525 Dereference null return value Change-Id: I0dae9e73e85cef74f041535f3787e3afb45bb94d Reviewed-on: https://gerrit.libreoffice.org/82989 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx index 4296aa23d35f..c88182b7a522 100644 --- a/sw/source/core/undo/SwUndoTOXChange.cxx +++ b/sw/source/core/undo/SwUndoTOXChange.cxx @@ -24,12 +24,22 @@ #include <doc.hxx> #include <node.hxx> +namespace +{ + sal_uLong GetSectionNodeIndex(SwTOXBaseSection const& rTOX) + { + const SwSectionNode* pSectNd = rTOX.GetFormat()->GetSectionNode(); + assert(pSectNd); + return pSectNd->GetIndex(); + } +} + SwUndoTOXChange::SwUndoTOXChange(const SwDoc *pDoc, SwTOXBaseSection const& rTOX, SwTOXBase const& rNew) : SwUndo(SwUndoId::TOXCHANGE, pDoc) , m_Old(rTOX) , m_New(rNew) - , m_nNodeIndex(rTOX.GetFormat()->GetSectionNode()->GetIndex()) + , m_nNodeIndex(GetSectionNodeIndex(rTOX)) { } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits