1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Fixes #4562: Ensure that invalid plugin settings do not crash the application

This commit is contained in:
Laurent Cozic
2021-04-11 11:51:40 +02:00
parent 9171a1ee9e
commit 7518ac00fc

View File

@@ -1147,6 +1147,8 @@ class Setting extends BaseModel {
}
static async registerSetting(key: string, metadataItem: SettingItem) {
if (metadataItem.isEnum && !metadataItem.options) throw new Error('The `options` property is required for enum types');
this.validateKey(key);
this.customMetadata_[key] = metadataItem;