diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-18 08:56:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-18 21:53:07 +0200 |
commit | 02379929bd0e1d1676635f0ca1920422702ebb7c (patch) | |
tree | 77d823954212fa34a0ce116f70a260863036fc2c | |
parent | ebcd77c9ea2550d4082abf42d35a95bff72a40a7 (diff) |
allow SvxOle2Shape::resetModifiedState to survive having no SdrObject
Change-Id: Iea059262c124e3f44249e49b4189732310d28156
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150538
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index ae26aaabeca6..bfde63a2bac1 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -499,10 +499,11 @@ void SvxOle2Shape::createLink( const OUString& aLinkURL ) void SvxOle2Shape::resetModifiedState() { - ::comphelper::IEmbeddedHelper* pPersist = GetSdrObject()->getSdrModelFromSdrObject().GetPersist(); + SdrObject* pObject = GetSdrObject(); + ::comphelper::IEmbeddedHelper* pPersist = pObject ? pObject->getSdrModelFromSdrObject().GetPersist() : nullptr; if( pPersist && !pPersist->isEnableSetModified() ) { - SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( GetSdrObject() ); + SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >(pObject); if( pOle && !pOle->IsEmpty() ) { uno::Reference < util::XModifiable > xMod( pOle->GetObjRef(), uno::UNO_QUERY ); |