svx/source/svdraw/svdpage.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1772c60c7a8b31edd1baebf60b0b589dc6d865df
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Jan 13 21:15:14 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Jan 14 10:50:43 2026 +0100

    Don't null-deref if pView is not present
    
    And default to COL_WHITE as view background if not present.
    
    Related: tdf#168710
    Change-Id: I184fb018d16ac83381b689093e751167bad2c2fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197222
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 1b240af4e5ca..4ad40165da7a 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1810,7 +1810,7 @@ SfxStyleSheet* SdrPage::GetTextStyleSheetForObject( 
SdrObject* pObj ) const
 // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay 
hint value
 Color SdrPage::GetPageBackgroundColor( SdrPageView const * pView, bool 
bScreenDisplay ) const
 {
-    Color aColor;
+    Color aColor(COL_WHITE);
 
     if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == 
COL_AUTO))
     {
@@ -1822,7 +1822,7 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView const 
* pView, bool bScreenDi
             aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
         }
     }
-    else
+    else if (pView)
     {
         aColor = pView->GetApplicationDocumentColor();
     }

Reply via email to