You've already forked joplin
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:
@@ -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('');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user