sw/source/core/crsr/swcrsr.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
New commits: commit a60f4a6222fdbcb4a1adebe670eaf1636a014da6 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Dec 10 17:04:59 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Dec 11 20:51:22 2020 +0100 sw: add missing nullptr check introduced by 0aa0fda64057647219954480ac1bab86b0f0e433 See: https://crashreport.libreoffice.org/stats/signature/SwCursor::UpDown(bool,unsigned%20short,Point%20const%20*,long,SwRootFrame%20&) Change-Id: Ifb7a86b0dfd1477d6ffa15c7d4d3289984747f87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107561 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 0a80dcad342c1be71f467e46a0cf4f5dd1259056) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107615 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e1237d8cffab..879d632dfc8b 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2044,9 +2044,15 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, } else { + sal_Int32 nOffset = 0; + // Jump to beginning or end of line when the cursor at first or last line. - SwNode& rNode = GetPoint()->nNode.GetNode(); - const sal_Int32 nOffset = bUp ? 0 : rNode.GetTextNode()->GetText().getLength(); + if(!bUp) + { + SwTextNode* pTextNd = GetPoint()->nNode.GetNode().GetTextNode(); + if (pTextNd) + nOffset = pTextNd->GetText().getLength(); + } const SwPosition aPos(*GetContentNode(), nOffset); //if cursor has already been at start or end of file, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits