diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-11-29 08:42:37 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-29 11:15:35 +0100 |
commit | 965e6308522a21e77a4b19cafd018973b4097224 (patch) | |
tree | 810d639e03d182cd0cb80af575d341b2ba3c890f | |
parent | 5d331f3c92623fe6cba089bf2c49e8b518d225dd (diff) |
cid#1494452 sfx2: fix null ptr deref in SfxInPlaceClient_Impl::saveObject()
Null-checking "this->m_pClient" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check. Add the
missing check at a previous usage.
(cherry picked from commit d9105d434ac6127f151843c7a7dbcd16257fcc0b)
Change-Id: I8ebb4f41b9c83d59e65563c26729e899d45881b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126014
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 08898ba1573f..ce9d2fdfb6c7 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -212,7 +212,7 @@ uno::Reference < frame::XFrame > const & SfxInPlaceClient_Impl::GetFrame() const void SAL_CALL SfxInPlaceClient_Impl::saveObject() { - if (!m_bStoreObject || m_pClient->IsProtected()) + if (!m_bStoreObject || (m_pClient && m_pClient->IsProtected())) // client wants to discard the object (usually it means the container document is closed while an object is active // and the user didn't request saving the changes return; |