fix(FlamePage): don't assert / suggest blocked modpacks

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-12-05 18:13:38 -03:00
parent bb386a1162
commit 6f50809457
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -217,12 +217,16 @@ void FlamePage::suggestCurrent()
void FlamePage::onVersionSelectionChanged(QString data) void FlamePage::onVersionSelectionChanged(QString data)
{ {
if (data.isNull() || data.isEmpty()) { bool is_blocked = false;
ui->versionSelectionBox->currentData().toInt(&is_blocked);
if (data.isNull() || data.isEmpty() || is_blocked) {
m_selected_version_index = -1; m_selected_version_index = -1;
return; return;
} }
m_selected_version_index = ui->versionSelectionBox->currentIndex(); m_selected_version_index = ui->versionSelectionBox->currentIndex();
Q_ASSERT(current.versions.at(m_selected_version_index).downloadUrl == ui->versionSelectionBox->currentData().toString()); Q_ASSERT(current.versions.at(m_selected_version_index).downloadUrl == ui->versionSelectionBox->currentData().toString());
suggestCurrent(); suggestCurrent();