diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-12 14:52:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-12 16:01:54 +0100 |
commit | 5a28f236523b8fa81f793264cd27a02668c94dd3 (patch) | |
tree | cd118e07c98c8e0c418f32c6ef4b8ff41fa224f0 /svx/source | |
parent | 8d704bb8672eb95e8cbce260668cb2ebe81f2834 (diff) |
Fix null pointer dereference
...when FindTextToolbarController instance is immediately disposed after
creation (as will happen in to-be-updated CppunitTest_services).
Change-Id: I459f2b2ac3eecc728b45e8493c3f8988a6c121a1
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 617d6609d41a..a60f9ccafb19 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -416,9 +416,12 @@ void SAL_CALL FindTextToolbarController::dispose() throw ( css::uno::RuntimeExce SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); svt::ToolboxController::dispose(); - SearchToolbarControllersManager::createControllersManager().saveSearchHistory(m_pFindTextFieldControl); - delete m_pFindTextFieldControl; - m_pFindTextFieldControl = 0; + if (m_pFindTextFieldControl != nullptr) { + SearchToolbarControllersManager::createControllersManager() + .saveSearchHistory(m_pFindTextFieldControl); + delete m_pFindTextFieldControl; + m_pFindTextFieldControl = 0; + } } // XInitialization |