system-setate: Fix Map parsing error on null values

This commit is contained in:
Danny Lin 2021-11-13 18:44:37 -08:00
parent 1997833649
commit b4ccae0946

View file

@ -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