From b6628dd8cb325a4050c75dbbe163f759a70cd1a3 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 1 Feb 2022 20:23:46 +0000 Subject: [PATCH] Fallback to empty list if budgets or accounts are unset --- web/src/store/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/store/index.ts b/web/src/store/index.ts index e361db1..c835abd 100644 --- a/web/src/store/index.ts +++ b/web/src/store/index.ts @@ -66,10 +66,10 @@ export const store = createStore({ state.CurrentAccountID = restoredState.CurrentAccountID; state.ShowMenu = restoredState.ShowMenu; - for (const budget of restoredState.Budgets) { + for (const budget of restoredState.Budgets || []) { state.Budgets.set(budget[0], budget[1]); } - for (const account of restoredState.Accounts) { + for (const account of restoredState.Accounts || []) { state.Accounts.set(account[0], account[1]); } },