Commit f553eb00 authored by coppro's avatar coppro

Changed so you can't delete last card in set.

(this can cause crashes, and an empty set seems pointless anyways.)
parent 5cbac658
......@@ -199,7 +199,8 @@ void CardsPanel::onCommand(int id) {
set->actions.add(new AddCardAction(*set));
break;
case ID_CARD_REMOVE:
if (card_list->getCard() != nullptr)
if (card_list->getCard() != nullptr && set->cards.size() != 1)
//Don't delete the last card, and certainly don't delete a card if none exists.
set->actions.add(new RemoveCardAction(*set, card_list->getCard()));
break;
case ID_CARD_ROTATE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment