Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311834

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/34/311834/1

diff --git a/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWEducationPopupTool.js
index 087e74c..c279377 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 {}
 
        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: newchange
Gerrit-Change-Id: I5faf5f4fce2f3161ad62d3617d1bb1d750a44728
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <a...@wikimedia.org>

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

Reply via email to