diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-03 11:38:10 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-02-03 12:23:56 +0100 |
commit | d04cf314d44c0ae0cbb135d21436d119f936208c (patch) | |
tree | 50cc170353079518478223aa081e320f0bb3d534 | |
parent | 9b5f1a79f52b3d541a978f117548e255febf39d4 (diff) |
libreofficekit: CppunitTest_libreofficekit_tiledrendering crashes
Need to check that a callback was actually set before calling it.
Change-Id: Icb2ca19aec0c74f6695d7286f046dadfe609d68c
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index a4a60c20bc82..e4c3ee563a4d 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -115,9 +115,9 @@ void LOKInteractionHandler::postError(css::task::InteractionClassification class std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - if (m_pLOKDocument) + if (m_pLOKDocument && m_pLOKDocument->mpCallback) m_pLOKDocument->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), m_pLOKDocument->mpCallbackData); - else + else if (m_pLOKit->mpCallback) m_pLOKit->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), m_pLOKit->mpCallbackData); } @@ -243,7 +243,8 @@ bool LOKInteractionHandler::handlePasswordRequest(const uno::Sequence<uno::Refer if (!(rRequest >>= passwordRequest)) return false; - if (m_pLOKit->hasOptionalFeature((passwordRequest.IsRequestPasswordToModify) + if (m_pLOKit->mpCallback && + m_pLOKit->hasOptionalFeature((passwordRequest.IsRequestPasswordToModify) ? LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY : LOK_FEATURE_DOCUMENT_PASSWORD)) { |