jenkins-bot has submitted this change and it was merged.

Change subject: Education popup: Put localStorage check inside try/catch
......................................................................


Education popup: Put localStorage check inside try/catch

Bug: T146139
Change-Id: I5faf5f4fce2f3161ad62d3617d1bb1d750a44728
---
M modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js
index 087e74c..3c11e0e 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js
@@ -18,7 +18,12 @@
        var popupCloseButton, $popupContent, $shield,
                usePrefs = !mw.user.isAnon(),
                prefSaysShow = usePrefs && !mw.user.options.get( 
'visualeditor-hideusered' ),
-               tool = this;
+               tool = this,
+               localStorageHidePref = null;
+
+       try {
+               localStorageHidePref = localStorage.getItem( 've-hideusered' );
+       } catch ( e ) {}
 
        config = config || {};
 
@@ -29,7 +34,7 @@
                        !prefSaysShow &&
                        !(
                                !usePrefs &&
-                               localStorage.getItem( 've-hideusered' ) === 
null &&
+                               localStorageHidePref === null &&
                                $.cookie( 've-hideusered' ) === null
                        )
                )

-- 
To view, visit https://gerrit.wikimedia.org/r/311834
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5faf5f4fce2f3161ad62d3617d1bb1d750a44728
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to