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

New commits:
commit eca9a29eb18048c40e05f6343fc0306f63d23f14
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Feb 18 13:06:56 2020 +0000
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Feb 19 10:55:14 2020 +0100

    Resolves: tdf#130756 null deref in empty treeview
    
    Change-Id: Ie43081d5c1feb655ea1479476375ee7381f0a0ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88948
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 8d775803e6b1..fb5c50bd0dda 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5080,7 +5080,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());
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to