From b4ccae0946836dfd2cc85404e150794231734c08 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 13 Nov 2021 18:44:37 -0800 Subject: [PATCH] system-setate: Fix Map parsing error on null values --- src/config/system-state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/system-state.ts b/src/config/system-state.ts index 07b8ec1..dff7579 100644 --- a/src/config/system-state.ts +++ b/src/config/system-state.ts @@ -37,7 +37,7 @@ export function serializeSystemState(state: SystemState) { export function parseSystemState(json: string) { let diskState = JSON.parse(json, (k, v) => { - if (v.hasOwnProperty('_type') && v._type == 'Map') { + if (v?.hasOwnProperty('_type') && v?._type == 'Map') { return new Map(Object.entries(v.data)) } else { return v