Skip to content

Commit

Permalink
Bugfix: avoid a segfault in the property editor due to invalid array …
Browse files Browse the repository at this point in the history
…access (difficult to reproduce).
  • Loading branch information
Matthias Koefferlein committed Aug 7, 2024
1 parent 4631a80 commit d31c9db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layui/layui/layPropertiesDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ PropertiesDialog::update_controls ()

mp_ui->apply_to_all_cbx->setChecked (m_object_indexes.size () > 1);

if (m_index < 0) {
if (m_index < 0 || m_index >= int (mp_properties_pages.size ())) {

mp_stack->setCurrentWidget (mp_none);

Expand Down Expand Up @@ -552,6 +552,10 @@ PropertiesDialog::apply ()
{
BEGIN_PROTECTED

if (m_index < 0 || m_index >= int (mp_properties_pages.size ())) {
return;
}

db::Transaction t (mp_manager, tl::to_string (QObject::tr ("Apply changes")), m_transaction_id);

try {
Expand Down

0 comments on commit d31c9db

Please sign in to comment.