mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 09:03:57 -07:00
fix crash
This commit is contained in:
parent
07342f817d
commit
8a0b6761d5
1 changed files with 5 additions and 3 deletions
|
|
@ -207,11 +207,13 @@ QModelIndex DeckStateManager::decrementCard(const ExactCard &card, const QString
|
|||
return {};
|
||||
}
|
||||
|
||||
if (idx.isValid()) {
|
||||
emit focusIndexChanged(idx, true);
|
||||
// old index is no longer safe since rows could have been removed
|
||||
QModelIndex newIdx = deckListModel->findCard(card.getName(), zoneName, providerId, collectorNumber);
|
||||
if (newIdx.isValid()) {
|
||||
emit focusIndexChanged(newIdx, true);
|
||||
}
|
||||
|
||||
return idx;
|
||||
return newIdx;
|
||||
}
|
||||
|
||||
static bool doSwapCard(DeckListModel *model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue