Skip to content

Commit

Permalink
Avoid exception when deck isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Dec 9, 2023
1 parent eba617e commit 8a128a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/store/deck-list-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ export class DeckListStore {
const deckIndex = this.myInfo.value.myDecks.findIndex(
(myDeck) => myDeck.id === deck.id,
);
assert(deckIndex !== -1, "Deck not found in myDecks");
this.myInfo.value.myDecks[deckIndex] = deck;
if (deckIndex !== -1) {
this.myInfo.value.myDecks[deckIndex] = deck;
}
}

get publicDecks() {
Expand Down

0 comments on commit 8a128a6

Please sign in to comment.