summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-17 09:01:59 +0100
committerAndras Timar <andras.timar@collabora.com>2019-08-22 12:33:11 +0200
commit31965ff838346d447fbeb1324f41bdd3cd992269 (patch)
treeb6f385a7834c4ffce061dc5bccd4a067b0793865
parent47c6a3beb31288a7ae8ef61530be77f5ab00b9c1 (diff)
ofz#10395 Null-dereference
Reviewed-on: https://gerrit.libreoffice.org/60559 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 07b3bfb125fae70e0ab796a929a4f2abe4937912) Reviewed-on: https://gerrit.libreoffice.org/60564 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit fde33870d6989efeb59355aad1209a7f50e7ecf6) Change-Id: I7bde5987a51949d60174335327652186e0ad8998
-rw-r--r--oox/source/shape/WpsContext.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 5fbea5fb225b..b8916bea9175 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -178,11 +178,14 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
if (rAttribs.hasAttribute(XML_prst))
{
uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
- oox::OptValue<OUString> presetShapeName = rAttribs.getString(XML_prst);
- const OUString& preset = presetShapeName.get();
- comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry"));
- aCustomShapeGeometry["PresetTextWarp"] = uno::makeAny(preset);
- xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList()));
+ if (xPropertySet.is())
+ {
+ oox::OptValue<OUString> presetShapeName = rAttribs.getString(XML_prst);
+ const OUString& preset = presetShapeName.get();
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry"));
+ aCustomShapeGeometry["PresetTextWarp"] <<= preset;
+ xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList()));
+ }
}
break;
case XML_txbx: