sw/source/core/frmedt/feshview.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0d9c73734dcd5c1bdff41281afcb415db0f95377
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Sep 14 20:18:55 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Sep 15 09:32:54 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>

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 1c19ffb4eca4..eefb9d6d0643 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 )
                 {

Reply via email to