sw/source/core/doc/notxtfrm.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit cb08fb797c58a4d21e7ae3a700b0e9ed30524a90 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 19 19:39:00 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Sep 19 22:33:19 2024 +0200 null-deref seen on rtf2pdf with tdf94049-1.rtf Change-Id: I9cd64f5fb20ccea84446909414624314b7eb956b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173684 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index fbbcc035b118..f785718035fe 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1417,12 +1417,13 @@ void SwNoTextFrame::ImplPaintPictureBitmap( vcl::RenderContext* pOut, const Point aPosition(rAlignedGrfArea.Pos()); const Size aSize(rAlignedGrfArea.SSize()); + uno::Reference<embed::XEmbeddedObject> xObj = pOLENd->GetOLEObj().GetOleRef(); + if ( pGraphic && pGraphic->GetType() != GraphicType::NONE ) { pGraphic->Draw(*pOut, aPosition, aSize); // shade the representation if the object is activated outplace - uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE ) { @@ -1441,7 +1442,7 @@ void SwNoTextFrame::ImplPaintPictureBitmap( vcl::RenderContext* pOut, pOut); } - sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() ); + sal_Int64 nMiscStatus = xObj ? xObj->getStatus(pOLENd->GetAspect()) : 0; if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE)) {