Make sure to have a graphic here

Commit 8872f7121b (crashtesting: crash
on exporting kde274105-6.docx to .rtf, 2024-03-27) made sure to provide
a graphic in all cases, to avoid crashes revealed by crashtesting.
In commit f317746f55, I removed that.
This reinstates the safety measure for cases when there's no graphic
yet.

Change-Id: Ida3eecd5c7ccff087c2ca8b6076ca01b8a145adc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173697
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2024-09-20 13:47:06 +05:00
parent 66cf208718
commit 2469e69af8

View file

@ -477,6 +477,10 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
return;
}
// Missing graphic can crash
if (!mpImpl->oGraphic)
mpImpl->oGraphic.emplace();
std::unique_ptr<SvStream> pGraphicStream(GetGraphicStream( bUpdate ));
if (!pGraphicStream && aOldGraphic.IsNone())
{