fix(store): fix TypeError: Cannot convert undefined or null to object

This commit is contained in:
JellyBrick
2023-11-28 05:51:47 +09:00
parent ac0b78eefb
commit 09450fb8c7

View File

@ -85,7 +85,8 @@ const migrations = {
shortcut: unknown;
}[]
| Record<string, unknown>
>;
> | undefined;
if (options) {
let updated = false;
for (const optionType of ['global', 'local']) {
if (Object.hasOwn(options, optionType) && Array.isArray(options[optionType])) {
@ -104,10 +105,10 @@ const migrations = {
updated = true;
}
}
if (updated) {
store.set('plugins.shortcuts', options);
}
}
},
'>=1.11.0'(store: Conf<Record<string, unknown>>) {
if (store.get('options.resumeOnStart') === undefined) {