1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Fixes #7621: Certain plugins could create invalid settings, which could result in a crash

This commit is contained in:
Laurent Cozic
2023-01-17 15:34:04 +00:00
parent f7682d3da3
commit dc5dc94ed5
3 changed files with 60 additions and 25 deletions

View File

@@ -379,4 +379,19 @@ describe('models/Setting', function() {
}
});
test('values should not be undefined when they are set', async () => {
Setting.setValue('locale', undefined);
expect(Setting.value('locale')).toBe('');
});
test('values should not be undefined when registering a setting', async () => {
await Setting.registerSetting('myCustom', {
public: true,
value: undefined,
type: Setting.TYPE_STRING,
});
expect(Setting.value('myCustom')).toBe('');
});
});