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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_model.js

Issue 667933003: Ensure existence of queried elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make some parameters non-nullable. Created 6 years, 2 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 | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/directory_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index 1f9435318a59f7099650efb829bb2981c76d37c1..f6202097bcbbfe611cb044bf30b2994ca194e356 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -274,7 +274,8 @@ DirectoryModel.prototype.setSelectedEntries_ = function(value) {
*/
DirectoryModel.prototype.getLeadEntry_ = function() {
var index = this.fileListSelection_.leadIndex;
- return index >= 0 && this.getFileList().item(index);
+ return index >= 0 ?
+ /** @type {Entry} */ (this.getFileList().item(index)) : null;
};
/**
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698