diff --git a/src/layui/layui/layPropertiesDialog.cc b/src/layui/layui/layPropertiesDialog.cc index 8a0fbe274..773dcf1c5 100644 --- a/src/layui/layui/layPropertiesDialog.cc +++ b/src/layui/layui/layPropertiesDialog.cc @@ -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); @@ -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 {