From be7c4538ba1c29dcc3840acb5227460bc2d9b142 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 1 Sep 2024 18:10:14 +0200 Subject: [PATCH] Fixed a crash in the properties editor This crash happened sometimes when clicking on the node elements (e.g. "Boxes" or "Instances") of the object tree, the node was the second or further one and the category clicked at was containing one item only. --- src/layui/layui/layPropertiesDialog.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layui/layui/layPropertiesDialog.cc b/src/layui/layui/layPropertiesDialog.cc index 0e794983f..6ecffff16 100644 --- a/src/layui/layui/layPropertiesDialog.cc +++ b/src/layui/layui/layPropertiesDialog.cc @@ -343,9 +343,9 @@ PropertiesDialog::current_index_changed (const QModelIndex &index, const QModelI m_object_indexes.push_back (oi); } - } else { + } else if (mp_properties_pages [m_index]->count () > 0) { - m_object_indexes.push_back (size_t (mp_tree_model->object_index (index))); + m_object_indexes.push_back (0); }