summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-18 13:06:56 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-02-19 10:55:00 +0100
commit27badf859389b20d03b96e7459a8110bc48224db (patch)
tree731e3c67b8a816299a6bc2fda3afe66f17234e83 /vcl
parent3d96ef3b8947790b3a0af3a26618ec731dfd77a8 (diff)
Resolves: tdf#130756 null deref in empty treeview
Change-Id: Ie43081d5c1feb655ea1479476375ee7381f0a0ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88947 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e1baf6c61d90..48f960f851c0 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6035,7 +6035,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());