editeng/source/editeng/impedit2.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cf42d70e8c50cecd865fdb16d4d8e9e86fc3db25
Author:     Jonathan Clark <jonat...@libreoffice.org>
AuthorDate: Thu Nov 14 00:32:55 2024 -0700
Commit:     Jonathan Clark <jonat...@libreoffice.org>
CommitDate: Thu Nov 14 10:29:31 2024 +0100

    cid#1634809 Null pointer dereferences
    
    and
    
    cid#1634807 Null pointer dereferences
    
    Change-Id: I9a100651a744cb77ff89769e8c98afcfb771f593
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176563
    Tested-by: Jenkins
    Reviewed-by: Jonathan Clark <jonat...@libreoffice.org>

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index cd5d25cfd90e..88b047f1e8e4 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3787,11 +3787,11 @@ Point ImpEditEngine::GetDocPosTopLeft( sal_Int32 
nParagraph )
     const ParaPortion* pPPortion = maParaPortionList.SafeGetObject(nParagraph);
     DBG_ASSERT( pPPortion, "Paragraph not found: GetWindowPosTopLeft" );
 
-    auto stMetrics = GetFontUnitMetrics(pPPortion->GetNode());
-
     Point aPoint;
     if ( pPPortion )
     {
+        auto stMetrics = GetFontUnitMetrics(pPPortion->GetNode());
+
         // If someone calls GetLineHeight() with an empty Engine.
         DBG_ASSERT(IsFormatted() || !IsFormatting(), "GetDocPosTopLeft: Doc 
not formatted - unable to format!");
         if (!IsFormatted())

Reply via email to