Commit 553dd64f authored by coppro's avatar coppro

Fix crash when dragging card list past end.

parent b1ccf17c
...@@ -103,6 +103,7 @@ void CardListBase::onAction(const Action& action, bool undone) { ...@@ -103,6 +103,7 @@ void CardListBase::onAction(const Action& action, bool undone) {
} }
TYPE_CASE(action, ReorderCardsAction) { TYPE_CASE(action, ReorderCardsAction) {
if (sort_by_column >= 0) return; // nothing changes for us if (sort_by_column >= 0) return; // nothing changes for us
if ((long)action.card_id1 < 0 || (long)action.card_id2 >= sorted_list.size()) return;
if ((long)action.card_id1 == selected_item_pos || (long)action.card_id2 == selected_item_pos) { if ((long)action.card_id1 == selected_item_pos || (long)action.card_id2 == selected_item_pos) {
// Selected card has moved; also move in the sorted card list // Selected card has moved; also move in the sorted card list
swap(sorted_list[action.card_id1], sorted_list[action.card_id2]); swap(sorted_list[action.card_id1], sorted_list[action.card_id2]);
......
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