summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/main/ChartController.cxx3
1 files changed, 3 insertions, 0 deletions
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<css::chart2::XChartType> getChartType(
const css::uno::Reference<css::chart2::XChartDocument>& xChartDoc)
{
Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+ if (xDiagram == nullptr) {
+ return css::uno::Reference<css::chart2::XChartType>();
+ }
Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW );