[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 18 16:25:20 UTC 2020


 vcl/source/app/salvtables.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fe5a839de9b0291e4473ae45b18a540cd5e78ffe
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 18 13:06:56 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 18 17:24:39 2020 +0100

    Resolves: tdf#130756 null deref in empty treeview
    
    Change-Id: Ie43081d5c1feb655ea1479476375ee7381f0a0ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88934
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 5b2a288c8bc5..d04ccbff4c87 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6466,7 +6466,10 @@ IMPL_LINK(SalInstanceEntryTreeView, KeyPressListener, VclWindowEvent&, rEvent, v
         m_pTreeView->disable_notify_events();
         auto& rListBox = m_pTreeView->getTreeView();
         if (!rListBox.FirstSelected())
-            rListBox.Select(rListBox.First(), true);
+        {
+            if (SvTreeListEntry* pEntry = rListBox.First())
+                rListBox.Select(pEntry, true);
+        }
         else
             rListBox.KeyInput(rKeyEvent);
         m_xEntry->set_text(m_xTreeView->get_selected_text());


More information about the Libreoffice-commits mailing list