sw/source/core/frmedt/feshview.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit c1e922b3718358d65a329b7a74738fc6523348af Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 14 20:18:55 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Fri Sep 15 11:51:35 2023 +0200 crashreporting: apparent null deref at SwFEShell::IsShapeDefaultHoriTextDirR2L https: //crashreport.libreoffice.org/stats/crash_details/73028951-19a0-409b-89d2-a080495df925 Change-Id: I440465a3c7d5b98ecdd1c5f1973a2b8f64d6772e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156888 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 7a33e2f4c6a1a3c489b6deaeaae1489acb0aa389) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156889 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index aec1e9693d7f..8e91c2af68cd 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -3320,8 +3320,11 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr ) { // determine page frame of the frame the shape is anchored. - const SwFrame* pAnchorFrame = - static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrame( pSdrObj ); + const SwContact* pContact = GetUserCall(pSdrObj); + OSL_ENSURE( pContact, "<SwFEShell::IsShapeDefaultHoriTextDirR2L(..)> - missing contact!" ); + if (!pContact) + return false; + const SwFrame* pAnchorFrame = static_cast<const SwDrawContact*>(pContact)->GetAnchorFrame( pSdrObj ); OSL_ENSURE( pAnchorFrame, "inconsistent model - no anchor at shape!"); if ( pAnchorFrame ) {