Bugfix: avoid a segfault in the property editor due to invalid array access (difficult to reproduce).

This commit is contained in:
Matthias Koefferlein 2024-08-07 22:38:18 +02:00
parent 4631a806ef
commit d31c9dbf6c
1 changed files with 5 additions and 1 deletions

View File

@ -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 {