Merge pull request #1333 from Ryex/fix/null_instance_edit_crash

This commit is contained in:
Sefa Eyeoglu 2023-07-12 15:53:46 +02:00
parent 6f86e8b66e
commit a0ddd85b32
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -1279,7 +1279,17 @@ void MainWindow::globalSettingsClosed()
void MainWindow::on_actionEditInstance_triggered()
{
APPLICATION->showInstanceWindow(m_selectedInstance);
if (!m_selectedInstance)
return;
if (m_selectedInstance->canEdit()) {
APPLICATION->showInstanceWindow(m_selectedInstance);
} else {
CustomMessageBox::selectable(this, tr("Instance not editable"),
tr("This instance is not editable. It may be broken, invalid, or too old. Check logs for details."),
QMessageBox::Critical)->show();
}
}
void MainWindow::on_actionManageAccounts_triggered()