diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx index 32763beb02e7..31808b1a292b 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx @@ -72,8 +72,19 @@ ChartColorWrapper::ChartColorWrapper( void ChartColorWrapper::operator()(const OUString& , const NamedColor& rColor) { + if (!mxModel.is()) + { + SAL_WARN("chart2", "Invalid reference to mxModel"); + return; + } + css::uno::Reference xPropSet = getPropSet(mxModel); - assert(xPropSet.is()); + + if (!xPropSet.is()) + { + SAL_WARN("chart2", "Invalid reference to xPropSet"); + return; + } xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.first)); }