summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-12-13 16:02:17 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-12-13 15:19:28 +0100
commit4134b2cfb80d0b04204863789e72303f60712ba1 (patch)
treef95109914853e773329fe258c59b1c23044cdc3c /chart2
parent6c0ddbaec3db2958b8c393b54ca29dd3862d931a (diff)
tdf#129056: No need for catastrophe
We can continue working without hurting others in case of an invalid reference. Putting in a warning so that it doesn't become a black hole which silences errors. Change-Id: I6d75edeba227a4293b0ae16217811e49ae336a6b Reviewed-on: https://gerrit.libreoffice.org/85110 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index 6c9744ffee02..49a3cf5b9eba 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -70,8 +70,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<css::beans::XPropertySet> 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));
}