summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index f146b30b6a80..6768fc2fe30b 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -307,7 +307,7 @@ IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, rKEvt, bool)
if (rKeyCode.GetCode() == KEY_RETURN)
{
std::unique_ptr<weld::TreeIter> xCursor(m_xTreeView->make_iterator());
- if (m_xTreeView->get_cursor(xCursor.get()))
+ if (m_xTreeView->get_cursor(xCursor.get()) && m_xTreeView->iter_has_child(*xCursor))
{
if (m_xTreeView->get_row_expanded(*xCursor))
m_xTreeView->collapse_row(*xCursor);