Pārlūkot izejas kodu

Fix rewards bug

nordsoft 3 gadi atpakaļ
vecāks
revīzija
cd28a0791b
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      mapeditor/inspector/rewardswidget.cpp

+ 6 - 2
mapeditor/inspector/rewardswidget.cpp

@@ -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;
+	}
 }