sc/source/ui/drawfunc/fuins2.cxx | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-)
New commits: commit 0dde33310b5c53b42e56850422a36273e7d5f7e2 Author: Xisco Fauli <[email protected]> AuthorDate: Fri Jan 23 12:13:12 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Fri Jan 23 16:25:52 2026 +0100 crashreporting: check xObj like it's done a few lines above Seen in https://crashreport.libreoffice.org/stats/crash_details/978290ff-67d0-4ad4-afdc-b1e79a58b7c2 Change-Id: Ic890513ba6f87b4172966ea004496cbaa755b2a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197941 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins Tested-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 56d7eeee1e16..e76a8fe873ae 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -507,24 +507,28 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV xChartModel->lockControllers(); // object size - awt::Size aSz = xObj->getVisualAreaSize( nAspect ); - Size aSize( aSz.Width, aSz.Height ); + Size aSize; + if (xObj.is()) + { + awt::Size aSz = xObj->getVisualAreaSize( nAspect ); + aSize = Size( aSz.Width, aSz.Height ); - MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); + MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); - bool bSizeCh = false; - if (aSize.IsEmpty()) - { - aSize.setWidth( 5000 ); - aSize.setHeight( 5000 ); - bSizeCh = true; - } - if (bSizeCh) - { - aSize = OutputDevice::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) ); - aSz.Width = aSize.Width(); - aSz.Height = aSize.Height(); - xObj->setVisualAreaSize( nAspect, aSz ); + bool bSizeCh = false; + if (aSize.IsEmpty()) + { + aSize.setWidth( 5000 ); + aSize.setHeight( 5000 ); + bSizeCh = true; + } + if (bSizeCh) + { + aSize = OutputDevice::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) ); + aSz.Width = aSize.Width(); + aSz.Height = aSize.Height(); + xObj->setVisualAreaSize( nAspect, aSz ); + } } ScViewData& rData = rViewSh.GetViewData();
