[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/jsdialog

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 19 01:20:43 UTC 2021


 vcl/jsdialog/jsdialogbuilder.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit a8de3a3f83615cdbb113f7713227a64621e937d8
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Dec 22 16:40:20 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Jan 19 02:20:08 2021 +0100

    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 at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109203
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 0cd9661b76ec..ceff10569e51 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -142,7 +142,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)
@@ -434,15 +435,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")
         {


More information about the Libreoffice-commits mailing list