Merge "Avoid (safe) exception by using empty options"
This commit is contained in:
@@ -101,7 +101,9 @@
|
|||||||
this.preferences = preferenceStore().get( this.preferenceName );
|
this.preferences = preferenceStore().get( this.preferenceName );
|
||||||
} else {
|
} else {
|
||||||
var options = mw.user.options.get( this.preferenceName );
|
var options = mw.user.options.get( this.preferenceName );
|
||||||
|
if ( !options ) {
|
||||||
|
options = '{}';
|
||||||
|
}
|
||||||
// Try to parse JSON
|
// Try to parse JSON
|
||||||
try {
|
try {
|
||||||
this.preferences = JSON.parse( options );
|
this.preferences = JSON.parse( options );
|
||||||
|
|||||||
Reference in New Issue
Block a user