aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-09 21:23:41 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-09 21:23:41 +0300
commitf2932c6d0387c41bd876d4af4148a7ffb5c83154 (patch)
tree516c7fed3936cf015d0dd2359e623dd29b32e0db /launcher/ui
parentbfe7e3afed286de02dfc1ec4cc2b39f31972d295 (diff)
downloadPrismLauncher-f2932c6d0387c41bd876d4af4148a7ffb5c83154.tar.gz
PrismLauncher-f2932c6d0387c41bd876d4af4148a7ffb5c83154.tar.bz2
PrismLauncher-f2932c6d0387c41bd876d4af4148a7ffb5c83154.zip
Fixed some crashes
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/pages/modplatform/ResourcePage.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp
index 736034ad..2bb86777 100644
--- a/launcher/ui/pages/modplatform/ResourcePage.cpp
+++ b/launcher/ui/pages/modplatform/ResourcePage.cpp
@@ -240,10 +240,13 @@ void ResourcePage::updateSelectionButton()
}
m_ui->resourceSelectionButton->setEnabled(true);
- if (!getCurrentPack()->isVersionSelected(m_selected_version_index)) {
- m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
+ if (getCurrentPack()) {
+ if (!getCurrentPack()->isVersionSelected(m_selected_version_index))
+ m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
+ else
+ m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
} else {
- m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
+ qWarning() << "Try to update selection but there is not a pack selected";
}
}