sw/source/core/crsr/swcrsr.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
New commits: commit 0a80dcad342c1be71f467e46a0cf4f5dd1259056 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Dec 10 17:04:59 2020 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Dec 11 16:32:25 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 <[email protected]> diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 4d95fb1b5394..a2c4264f6301 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2092,9 +2092,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 [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
