sw/source/core/unocore/unoportenum.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
New commits: commit 2fe360492ecee70b1ea2bc6aa6aa97b7d8652cfe Author: Caolán McNamara <caol...@redhat.com> Date: Tue Jun 26 12:15:19 2018 +0100 forcepoint#48 null deref Change-Id: I790fc6dafc0d8c9783b9dddc266b313af2a046d7 Reviewed-on: https://gerrit.libreoffice.org/56460 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/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 2506285ad866..85877cbdf81d 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -286,25 +286,27 @@ namespace ::sw::mark::AnnotationMark* const pAnnotationMark = dynamic_cast< ::sw::mark::AnnotationMark* >(ppMark->get()); - if ( pAnnotationMark == nullptr ) - { + if (!pAnnotationMark) continue; - } const SwPosition& rStartPos = pAnnotationMark->GetMarkStart(); - if ( rStartPos.nNode == nOwnNode ) + if (rStartPos.nNode != nOwnNode) + continue; + + const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField(); + if (!pAnnotationFormatField) { - const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField(); - assert(pAnnotationFormatField != nullptr); - rAnnotationStartArr.insert( - std::make_shared<SwAnnotationStartPortion_Impl>( - SwXTextField::CreateXTextField(&rDoc, - pAnnotationFormatField), - rStartPos)); + SAL_WARN("sw.core", "missing annotation format field"); + continue; } + + rAnnotationStartArr.insert( + std::make_shared<SwAnnotationStartPortion_Impl>( + SwXTextField::CreateXTextField(&rDoc, + pAnnotationFormatField), + rStartPos)); } } - } const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits