diff options
author | Justin Luth <jluth@mail.com> | 2023-08-15 08:55:09 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-08-15 19:04:45 +0200 |
commit | 918cd8cbf383e0099d80db2e12a1071a0bc4f200 (patch) | |
tree | ee02cc74a4fc25c69722d174d357c23f6b314be0 /vcl/source | |
parent | 6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb (diff) |
VCLSession: avoid null dereferences
Found while I was (mis)using
XSessionManagerListener2 in
https://gerrit.libreoffice.org/c/core/+/155460
But I think these are valid anyway.
Certainly one is when it is checked in the try clause
but not in the catch clause.
Change-Id: Ia3f7211e4a4c86dd503ffe1b04e5b5c13227218e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155719
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/session.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index c0dfe71d7bc3..3b1bf3565bb2 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -309,7 +309,9 @@ void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionMa osl::MutexGuard aGuard( m_aMutex ); if( ! m_bInteractionRequested ) { - m_xSession->queryInteraction(); + if (m_xSession) + m_xSession->queryInteraction(); + m_bInteractionRequested = true; } for (auto & listener: m_aListeners) |