diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-06-21 15:35:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 15:35:09 +0100 |
commit | 0975dbc3dd3589d10338c9821a7dbc36a5bfaafb (patch) | |
tree | f98d8e4c61ae76348aa3c335307070a558fcd72d /launcher/ui/pages/modplatform/ModPage.cpp | |
parent | 8aa02320e0c65647675f47de64217c3399650b02 (diff) | |
parent | d02858040ef0d1f691b3456bb0ac271c484a7c57 (diff) | |
download | PrismLauncher-0975dbc3dd3589d10338c9821a7dbc36a5bfaafb.tar.gz PrismLauncher-0975dbc3dd3589d10338c9821a7dbc36a5bfaafb.tar.bz2 PrismLauncher-0975dbc3dd3589d10338c9821a7dbc36a5bfaafb.zip |
Merge pull request #1228 from Trial97/curent_pack_crash
Fixes #1212
Diffstat (limited to 'launcher/ui/pages/modplatform/ModPage.cpp')
-rw-r--r-- | launcher/ui/pages/modplatform/ModPage.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 95064d16..60a43128 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -89,17 +89,13 @@ void ModPage::filterMods() void ModPage::triggerSearch() { - auto changed = m_filter_widget->changed(); m_filter = m_filter_widget->getFilter(); + m_ui->packView->clearSelection(); + m_ui->packDescription->clear(); + m_ui->versionSelectionBox->clear(); + updateSelectionButton(); - if (changed) { - m_ui->packView->clearSelection(); - m_ui->packDescription->clear(); - m_ui->versionSelectionBox->clear(); - updateSelectionButton(); - } - - static_cast<ModModel*>(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), changed); + static_cast<ModModel*>(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), m_filter_widget->changed()); m_fetch_progress.watch(m_model->activeSearchJob().get()); } @@ -122,6 +118,8 @@ void ModPage::updateVersionList() QString mcVersion = packProfile->getComponentVersion("net.minecraft"); auto current_pack = getCurrentPack(); + if (!current_pack) + return; for (int i = 0; i < current_pack->versions.size(); i++) { auto version = current_pack->versions[i]; bool valid = false; |