From fd68cfdeeb61d430cec1fcc21787be1c3d5141d7 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Mon, 30 Dec 2024 17:50:42 -0800 Subject: [PATCH] fix crash --- cockatrice/src/client/tabs/tab_deck_editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/client/tabs/tab_deck_editor.cpp b/cockatrice/src/client/tabs/tab_deck_editor.cpp index bd8fd3c52..90c022f08 100644 --- a/cockatrice/src/client/tabs/tab_deck_editor.cpp +++ b/cockatrice/src/client/tabs/tab_deck_editor.cpp @@ -1321,8 +1321,9 @@ void TabDeckEditor::actRemoveCard() void TabDeckEditor::offsetCountAtIndex(const QModelIndex &idx, int offset) { - if (!idx.isValid() || offset == 0) + if (!idx.isValid() || deckModel->hasChildren(idx)) { return; + } const QModelIndex numberIndex = idx.sibling(idx.row(), 0); const int count = deckModel->data(numberIndex, Qt::EditRole).toInt();