diff options
author | Henry Castro <hcastro@collabora.com> | 2020-12-22 16:40:20 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-04-09 11:55:31 +0200 |
commit | 8e4d4ebd28681439d42d09bbed98f861f59b4f1e (patch) | |
tree | 597ede70d8e0ed2e35e16fe2cb689088beb73155 /vcl | |
parent | 7f342a9874f64681628ec72b6d96d8fd607da765 (diff) |
jsdialog: fix disable idle notify
There is a possible crash due to nullptr deference
Change-Id: I3e2034ad89832eec61f1d6910a5ffd34c56df6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108224
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 84dcbda81208..0363d35867af 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -107,7 +107,8 @@ void JSDialogNotifyIdle::sendClose() { send(generateCloseMessage()); } void JSDialogSender::notifyDialogState(bool bForce) { - if (mpIdleNotify->getNotifierWindow()->IsDisableIdleNotify()) + auto aNotifierWnd = mpIdleNotify->getNotifierWindow(); + if (aNotifierWnd && aNotifierWnd->IsDisableIdleNotify()) return; if (bForce) @@ -401,15 +402,15 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id) m_xBuilder->drop_ownership(pDialog); m_bHasTopLevelDialog = true; + if (id == "MacroSelectorDialog") + pDialog->SetDisableIdleNotify(true); + pRet.reset(pDialog ? new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel, pDialog, this, false, m_sTypeOfJSON) : nullptr); RememberWidget("__DIALOG__", pRet.get()); - if (id == "MacroSelectorDialog") - pDialog->SetDisableIdleNotify(true); - const vcl::ILibreOfficeKitNotifier* pNotifier = pDialog->GetLOKNotifier(); if (pNotifier && id != "MacroSelectorDialog") { |