From 8b5f8c26f007c8e67bc46b1b09340cae660d0b8b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 21 Oct 2016 15:02:59 +0200 Subject: Avoid crash with empty Chart document In a fresh Writer document, "Insert - Object - OLE Object... - Create new - LibreOffice 5.3 Chart - OK", then left-clicking into the empty Chart are, caused an unhandled (or rather, handled by desktop's FatalError) RuntimeException since 749a0845500d69f99bf1901bab82361f67b5e4f6 "don't show area and line panel in pie chart Chart selection, tdf#94320". Change-Id: I7ff53a84e4b06b20409d09e6010bac80e5a7c4b2 --- chart2/source/controller/main/ChartController.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chart2') diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 1e2de86a2137..a4a641704dfb 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -278,6 +278,9 @@ css::uno::Reference getChartType( const css::uno::Reference& xChartDoc) { Reference xDiagram = xChartDoc->getFirstDiagram(); + if (xDiagram == nullptr) { + return css::uno::Reference(); + } Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW ); -- cgit