diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:31:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-24 14:31:31 +0000 |
commit | 32d4c191b1195be1061dfb6055908461e25a28fe (patch) | |
tree | 234ff25750421501f15628bfe160f459fc38c917 /sw | |
parent | a28ad8c96a6777fba734a4cc50c4fc56736dbaee (diff) |
coverity#1265800 Dereference null return value
Change-Id: Id5966c1f9b51ea47df52ad7a1e69a29a69e1764c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/textdrw.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx index ec30e19d1545..11ade2b2fc91 100644 --- a/sw/source/uibase/shells/textdrw.cxx +++ b/sw/source/uibase/shells/textdrw.cxx @@ -73,10 +73,14 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget, if (rMarkList.GetMark(0)) { SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj()); + OSL_ENSURE( pUnoCtrl, "not an SdrUnoObj" ); + if (!pUnoCtrl) + return; + uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel(); OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" ); - if( !xControlModel.is() ) + if (!xControlModel.is()) return; uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY); |