1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fix rewards bug

This commit is contained in:
nordsoft 2022-10-16 03:26:19 +04:00
parent dd463ca95a
commit cd28a0791b

View File

@ -346,8 +346,12 @@ void RewardsWidget::on_buttonAdd_clicked()
void RewardsWidget::on_buttonRemove_clicked()
{
ui->rewardsTable->removeRow(ui->rewardsTable->currentRow());
--rewards;
auto currentRow = ui->rewardsTable->currentRow();
if(currentRow != -1)
{
ui->rewardsTable->removeRow(currentRow);
--rewards;
}
}