From ba1ae835fa3629deb64b0a7a359cadc5aa0a9763 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 9 Sep 2014 16:48:29 +0200 Subject: oox: fix 0-pointer crash in sd_import_tests (regression from 43efd9b40d40b791a2c2deedcac36b99f7efb2cf) Change-Id: Ib8ee521cf8142000cbd38a7475772cc3455f7357 --- oox/source/drawingml/table/tablecell.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 40533259b9b3..f3810f1e2e85 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -361,8 +361,13 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo else if (rBackgroundFillStyle.mnThemedIdx != 0) if (const Theme* pTheme = rFilterBase.getCurrentTheme()) { - aBgColor = pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)->getBestSolidColor(); - nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper()); + FillProperties const*const pStyle( + pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)); + if (pStyle) + { + aBgColor = pStyle->getBestSolidColor(); + nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper()); + } } if (aBgColor.isUsed()) { -- cgit