aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-07-12 15:53:46 +0200
committerGitHub <noreply@github.com>2023-07-12 15:53:46 +0200
commit06a7d447f6ad1f2b77d47e4a43bdbe5b6aa9aa3a (patch)
tree0d3cb92e712e020a88983d8ea323bfd0b5401ee0 /launcher/ui
parent640aaa8c23d714ce17bc8e78754af6219abc6466 (diff)
parent1aa5fa03f94438ce53899e4660f12e794fd8bc35 (diff)
downloadPrismLauncher-06a7d447f6ad1f2b77d47e4a43bdbe5b6aa9aa3a.tar.gz
PrismLauncher-06a7d447f6ad1f2b77d47e4a43bdbe5b6aa9aa3a.tar.bz2
PrismLauncher-06a7d447f6ad1f2b77d47e4a43bdbe5b6aa9aa3a.zip
Merge pull request #1333 from Ryex/fix/null_instance_edit_crash
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/MainWindow.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index fe364937..ed894ead 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1280,7 +1280,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()