diff --git a/resources/js/ext.uls.preferences.js b/resources/js/ext.uls.preferences.js index f4f99ffb..cebc20eb 100644 --- a/resources/js/ext.uls.preferences.js +++ b/resources/js/ext.uls.preferences.js @@ -180,8 +180,15 @@ this.preferences = preferenceStore().get( this.preferenceName ); } else { var options = mw.user.options.get( this.preferenceName ); - this.preferences = JSON.parse( options ); + + // Try to parse JSON + try { + this.preferences = JSON.parse( options ); + } catch ( e ) { + this.preferences = {}; + } } + this.preferences = this.preferences || {}; },