Skip to content

Commit 9363969

Browse files
committed
Merge pull request #48 from lolsatbirds/master
Fixed crash when a game is added with an empty launcher.
2 parents 6124e81 + bcf1bd7 commit 9363969

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

addgamedialog.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,15 @@ void AddGameDialog::on_buttonBox_accepted()
6161
game.setType(Executable);
6262
if(ui->launcherEnabledCheckBox->isChecked())
6363
{
64-
game.setLauncher(launchers->at(ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt()));
64+
if ((ui->launcherComboBox->itemText(ui->launcherComboBox->currentIndex()).isEmpty()) || (ui->launcherComboBox->itemText(ui->launcherComboBox->currentIndex()).isNull()))
65+
{
66+
67+
ui->launcherEnabledCheckBox->setChecked(false);
68+
}
69+
else
70+
{
71+
game.setLauncher(launchers->at(ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt()));
72+
}
6573
}
6674

6775
emit AddGameDialog::gameSet(game);

0 commit comments

Comments
 (0)