From 38f08d3e909618c5d5271e2207f9fff6dcf5bf8a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 27 Aug 2023 11:28:20 +0200 Subject: [PATCH] Bugfix: avoid a segfault in the properties dialog --- src/layui/layui/layPropertiesDialog.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layui/layui/layPropertiesDialog.cc b/src/layui/layui/layPropertiesDialog.cc index f6ae37e2b..e37f31e94 100644 --- a/src/layui/layui/layPropertiesDialog.cc +++ b/src/layui/layui/layPropertiesDialog.cc @@ -272,6 +272,7 @@ PropertiesDialog::disconnect () delete *p; } mp_properties_pages.clear (); + m_index = -1; } void @@ -604,7 +605,7 @@ PropertiesDialog::ok_pressed () { BEGIN_PROTECTED - if (! mp_properties_pages [m_index]->readonly ()) { + if (m_index >= 0 && m_index < int (mp_properties_pages.size ()) && ! mp_properties_pages [m_index]->readonly ()) { db::Transaction t (mp_manager, tl::to_string (QObject::tr ("Apply changes")), m_transaction_id);