summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-09-14 20:18:55 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-11-24 21:58:21 +0100
commitc803721ad3d1b1d75e4115c9336da81b5ebeb8a3 (patch)
tree1391d522b242a27072f5122906f52707fab79866
parent7191131075e257eb41684df44d9d4fc40d0d1207 (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/+/156931 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 105d1c010c4dc3caedf66a2080045c9c5f6fb9e3)
-rw-r--r--sw/source/core/frmedt/feshview.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index fd0a930a95a0..65e684e1af06 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -3243,8 +3243,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 )
{