diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-21 15:02:59 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-10-25 10:53:06 +0000 |
commit | b5dedaaefb928957be225da3d13ff1a3959c47c3 (patch) | |
tree | 7d114bb1fcac4dc93c889d1582de4c5dd35c811e /chart2 | |
parent | 43d7d8df7306b80634c92bcfb94e45ceaefe1acf (diff) |
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".
(cherry picked from commit 8b5f8c26f007c8e67bc46b1b09340cae660d0b8b plus
c5feb9ad79c9c830ca824e29277ff41c5cc24e7d "Minor improvement of previous commit")
Change-Id: I7ff53a84e4b06b20409d09e6010bac80e5a7c4b2
Reviewed-on: https://gerrit.libreoffice.org/30139
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 5085223542aa..1a960a696384 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -284,6 +284,9 @@ css::uno::Reference<css::chart2::XChartType> getChartType( const css::uno::Reference<css::chart2::XChartDocument>& xChartDoc) { Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram(); + if (!xDiagram.is()) { + return css::uno::Reference<css::chart2::XChartType>(); + } Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW ); |