aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorTayou <git@tayou.org>2023-10-02 17:05:07 +0200
committerGitHub <noreply@github.com>2023-10-02 17:05:07 +0200
commit540fc7d2a82bc2eca57900b47e0b9cb75a07836e (patch)
tree325752f287f32183039e1281ba2a2ab078905977 /launcher
parentd612ab94a70cb2d5b64fe74771de0dd42043f6d9 (diff)
parent2cea7454efc8195f12b077adb67acfb2f064c0bd (diff)
downloadPrismLauncher-540fc7d2a82bc2eca57900b47e0b9cb75a07836e.tar.gz
PrismLauncher-540fc7d2a82bc2eca57900b47e0b9cb75a07836e.tar.bz2
PrismLauncher-540fc7d2a82bc2eca57900b47e0b9cb75a07836e.zip
Merge pull request #1670 from Trial97/seg_fault
Don't update mods if no mod loader is installed
Diffstat (limited to 'launcher')
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp
index 69c34daf..625d3793 100644
--- a/launcher/ui/pages/instance/ModFolderPage.cpp
+++ b/launcher/ui/pages/instance/ModFolderPage.cpp
@@ -206,6 +206,14 @@ void ModFolderPage::installMods()
void ModFolderPage::updateMods()
{
+ if (m_instance->typeName() != "Minecraft")
+ return; // this is a null instance or a legacy instance
+
+ auto profile = static_cast<MinecraftInstance*>(m_instance)->getPackProfile();
+ if (!profile->getModLoaders().has_value()) {
+ QMessageBox::critical(this, tr("Error"), tr("Please install a mod loader first!"));
+ return;
+ }
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
auto mods_list = m_model->selectedMods(selection);