Skip to content

Commit

Permalink
fix(MigrateState): add check
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Sep 30, 2022
1 parent ec8c450 commit 5d62ee4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/js/MigrateState.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
export function migrateState(state) {
const INITIAL_STATE_VERSION = state.version

if (INITIAL_STATE_VERSION == null) {
throw new Error('Invalid initial state version')
}

switch (INITIAL_STATE_VERSION) {
case 0:
state = migrateVersion0State(state)
Expand Down

0 comments on commit 5d62ee4

Please sign in to comment.