fix crash when no resorce version is available
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
e2b346fc53
commit
d31c947b36
@ -254,7 +254,10 @@ void ResourcePage::updateSelectionButton()
|
|||||||
|
|
||||||
m_ui->resourceSelectionButton->setEnabled(true);
|
m_ui->resourceSelectionButton->setEnabled(true);
|
||||||
if (auto current_pack = getCurrentPack(); current_pack) {
|
if (auto current_pack = getCurrentPack(); current_pack) {
|
||||||
if (!current_pack->isVersionSelected(m_selected_version_index))
|
if (current_pack->versionsLoaded && current_pack->versions.empty()) {
|
||||||
|
m_ui->resourceSelectionButton->setEnabled(false);
|
||||||
|
qWarning() << tr("No version available for the selected pack");
|
||||||
|
} else if (!current_pack->isVersionSelected(m_selected_version_index))
|
||||||
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
|
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
|
||||||
else
|
else
|
||||||
m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
|
m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
|
||||||
|
Loading…
Reference in New Issue
Block a user