Safeguarding against empty default profile
This commit is contained in:
parent
da8256f002
commit
af11eb9010
2 changed files with 12 additions and 1 deletions
|
|
@ -221,7 +221,7 @@ export class App {
|
|||
const devPrefSet = localStorage.getItem('device_preference_set') || 'default'
|
||||
const userData = localStorage.getItem('user') || '{"default": {}}'
|
||||
const user = JSON.parse(userData)
|
||||
return new N2PreferenceSet(devPrefSet, user.Preferences[devPrefSet])
|
||||
return new N2PreferenceSet(devPrefSet, user.Preferences[devPrefSet] || {})
|
||||
}// }}}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue