diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-09-14 20:18:55 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-09-18 10:13:51 +0200 |
commit | e8a4387848966616078bccc08bcf30c44d9af136 (patch) | |
tree | 81f49ba3f237a1e21b4431be57fdd808f4c30496 | |
parent | f6c47cdb578eb94212eae763855c734de3ed5c76 (diff) |
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 <xiscofauli@libreoffice.org>
(cherry picked from commit 7a33e2f4c6a1a3c489b6deaeaae1489acb0aa389)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156889
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 61f2a8ae30eb..a7e1e2228c12 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -3359,8 +3359,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 ) { |