diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-17 20:36:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 09:37:45 +0200 |
commit | 7fcb5c20310d23a4ede8b0a6e03ba23482792621 (patch) | |
tree | 9e166c6413c5dc25d7b519644b11989cbf7e4cfb /chart2/source | |
parent | e2cd1f41b8cb8a27155ce1ddddfe5760f05b7129 (diff) |
cid#1448236 Use after free
Change-Id: Id7a0ad49a8e73a6b12a0f40c4b8f62b1e1d64356
Reviewed-on: https://gerrit.libreoffice.org/75810
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/main/DrawCommandDispatch.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index 7a6a07b1ae41..7540d7962eae 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -371,8 +371,8 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea if ( pObj ) { SdrPageView* pPageView = pDrawViewWrapper->GetSdrPageView(); - pDrawViewWrapper->InsertObjectAtView( pObj, *pPageView ); - m_pChartController->SetAndApplySelection(Reference<drawing::XShape>(pObj->getUnoShape(), uno::UNO_QUERY)); + if (pDrawViewWrapper->InsertObjectAtView(pObj, *pPageView)) + m_pChartController->SetAndApplySelection(Reference<drawing::XShape>(pObj->getUnoShape(), uno::UNO_QUERY)); if ( nFeatureId == COMMAND_ID_DRAW_TEXT ) { m_pChartController->StartTextEdit(); |