Index: chrome/browser/resources/md_downloads/action_service.js |
diff --git a/chrome/browser/resources/md_downloads/action_service.js b/chrome/browser/resources/md_downloads/action_service.js |
index f984fe5a14614e3b853993e4dcaad33b70577641..e2c8c53213ec4ad772e70a7c889eefb03c2f6dcd 100644 |
--- a/chrome/browser/resources/md_downloads/action_service.js |
+++ b/chrome/browser/resources/md_downloads/action_service.js |
@@ -45,7 +45,7 @@ cr.define('downloads', function() { |
* (i.e. has a non-empty search term). |
*/ |
isSearching: function() { |
- return this.searchText_.length > 0; |
+ return (this.searchText_ || '').length > 0; |
}, |
/** Opens the current local destination for downloads. */ |
@@ -80,7 +80,8 @@ cr.define('downloads', function() { |
// Split quoted terms (e.g., 'The "lazy" dog' => ['The', 'lazy', 'dog']). |
function trim(s) { return s.trim(); } |
dpapad
2015/11/20 21:55:15
Nit: Add @param, @return?
Dan Beam
2015/11/21 01:40:42
Done.
|
- chrome.send('getDownloads', searchText.split(/"([^"]*)"/).map(trim)); |
+ chrome.send('getDownloads', |
+ searchText ? searchText.split(/"([^"]*)"/).map(trim) : []); |
dpapad
2015/11/20 21:55:15
Nit: Use isSearching instead of implicit conversio
Dan Beam
2015/11/21 01:40:42
ehhhhhhhhh
|
}, |
/** |