Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2215)

Unified Diff: chrome/browser/resources/options/language_list.js

Issue 1617243004: Stop checking for null selectionModel field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored correct code Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/language_list.js
diff --git a/chrome/browser/resources/options/language_list.js b/chrome/browser/resources/options/language_list.js
index 1030a0ac70e449e6cd59f36bf21855a1f61d738e..24467e0a02a66de65f81e9e54f3839ae90b7f9db 100644
--- a/chrome/browser/resources/options/language_list.js
+++ b/chrome/browser/resources/options/language_list.js
@@ -389,13 +389,12 @@ cr.define('options', function() {
*/
load_: function(languageCodes) {
// Preserve the original selected index. See comments below.
- var originalSelectedIndex = (this.selectionModel ?
- this.selectionModel.selectedIndex : -1);
+ var originalSelectedIndex = this.selectionModel.selectedIndex;
this.dataModel = new ArrayDataModel(languageCodes);
if (originalSelectedIndex >= 0 &&
originalSelectedIndex < this.dataModel.length) {
// Restore the original selected index if the selected index is
- // valid after the data model is loaded. This is neeeded to keep
+ // valid after the data model is loaded. This is needed to keep
// the selected language after the languge is added or removed.
this.selectionModel.selectedIndex = originalSelectedIndex;
// The lead index should be updated too.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698