nordsoft 3 роки тому
батько
коміт
cd28a0791b
1 змінених файлів з 6 додано та 2 видалено
  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;
+	}
 }