fix(instance edit): don't allow editing if no selected instance or instance doesn't support editing

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-07-08 12:59:55 -07:00
parent 67d473aab7
commit a54bbae622
No known key found for this signature in database
GPG Key ID: E10E321EB160949B

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()