Chromium Code Reviews| Index: chrome/browser/resources/md_bookmarks/actions.js |
| diff --git a/chrome/browser/resources/md_bookmarks/actions.js b/chrome/browser/resources/md_bookmarks/actions.js |
| index 11fd96e8c937921524ef2e88b5503962bd197b57..d104a31e4701bc0ae4a4ca068ca49c30dc90f20a 100644 |
| --- a/chrome/browser/resources/md_bookmarks/actions.js |
| +++ b/chrome/browser/resources/md_bookmarks/actions.js |
| @@ -97,10 +97,13 @@ cr.define('bookmarks.actions', function() { |
| /** |
| * @param {string} id |
| - * @return {!Action} |
| + * @param {NodeMap} nodes Current node state. Can be ommitted in tests. |
| + * @return {?Action} |
| */ |
| - function selectFolder(id) { |
| - assert(id != '0', 'Cannot select root folder'); |
| + function selectFolder(id, nodes) { |
| + if (nodes && (id == ROOT_NODE_ID || !nodes[id] || nodes[id].url)) |
|
calamity
2017/05/02 08:27:15
Hmm. Do you think it's reasonable to leave a conso
tsergeant
2017/05/03 02:57:31
I've added the warning. There are some legitimate
calamity
2017/05/03 07:49:46
Could you provide some examples?
tsergeant
2017/05/04 01:08:49
The main one is if you delete a folder that you ha
|
| + return null; |
| + |
| return { |
| name: 'select-folder', |
| id: id, |