Santhosh has uploaded a new change for review.

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

Change subject: Fix: ContentTranslation has an unguarded call to 
localStorage.setItem()
......................................................................

Fix: ContentTranslation has an unguarded call to localStorage.setItem()

Bug: T125369
Change-Id: I43241746c8d9806f0fc3cd6ff3b30a631c8f9828
---
M modules/source/ext.cx.source.selector.js
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/49/267649/1

diff --git a/modules/source/ext.cx.source.selector.js 
b/modules/source/ext.cx.source.selector.js
index 19edc76..dd96c49 100644
--- a/modules/source/ext.cx.source.selector.js
+++ b/modules/source/ext.cx.source.selector.js
@@ -203,7 +203,11 @@
                this.$sourceLanguage.prop( langProps )
                        .text( $.uls.data.getAutonym( language ) );
                if ( window.localStorage ) {
-                       localStorage.setItem( 'cxSourceLanguage', language );
+                       try {
+                               localStorage.setItem( 'cxSourceLanguage', 
language );
+                       } catch ( e ) {
+                               mw.log( 'Exception while setting 
cxSourceLanguage. ' + e.message );
+                       }
                }
                this.fillTargetLanguages();
        };
@@ -232,7 +236,11 @@
                this.$targetLanguage.prop( langProps )
                        .text( $.uls.data.getAutonym( language ) );
                if ( window.localStorage ) {
-                       localStorage.setItem( 'cxTargetLanguage', language );
+                       try {
+                               localStorage.setItem( 'cxTargetLanguage', 
language );
+                       } catch ( e ) {
+                               mw.log( 'Exception while setting 
cxTargetLanguage. ' + e.message );
+                       }
                }
        };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43241746c8d9806f0fc3cd6ff3b30a631c8f9828
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to