From bcf1bd7ff2277265fe97805eb98ff93891096a7d Mon Sep 17 00:00:00 2001 From: LolsAtBirds Date: Mon, 19 Oct 2015 18:26:27 -0400 Subject: [PATCH] Fixed crash when a game is added with an empty launcher. --- addgamedialog.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addgamedialog.cpp b/addgamedialog.cpp index 47ff565..0fbe485 100644 --- a/addgamedialog.cpp +++ b/addgamedialog.cpp @@ -61,7 +61,15 @@ void AddGameDialog::on_buttonBox_accepted() game.setType(Executable); if(ui->launcherEnabledCheckBox->isChecked()) { - game.setLauncher(launchers->at(ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt())); + if ((ui->launcherComboBox->itemText(ui->launcherComboBox->currentIndex()).isEmpty()) || (ui->launcherComboBox->itemText(ui->launcherComboBox->currentIndex()).isNull())) + { + + ui->launcherEnabledCheckBox->setChecked(false); + } + else + { + game.setLauncher(launchers->at(ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt())); + } } emit AddGameDialog::gameSet(game);